Mollie Payments for WooCommerce - Version 4.0.2

Version Description

  • 07-08-2018 =

  • Fix - Reverted to older version of Mollie API PHP client, as it caused more issues than it fixed. This means conflicts with other plugins that use Guzzle are still possible. Use Mollie Payments For WooCommerce 3.0.6 if you also use plugins Klarna, Simple Locator, Cardinity, LeadPages, ConstantContact until we can provide a solution. If you experience issues, please contact us. Please review this article.

Download this release

Release Info

Developer davdebcom
Plugin Icon wp plugin Mollie Payments for WooCommerce
Version 4.0.2
Comparing to
See all releases

Code changes from version 4.0.1 to 4.0.2

Files changed (179) hide show
  1. assets/images/creditcards-all.svg +54 -0
  2. assets/images/creditcards.svg +14 -27
  3. includes/mollie-api-php/README.md +1 -1
  4. includes/mollie-api-php/composer.json +68 -68
  5. includes/mollie-api-php/examples/01-new-payment.php +29 -13
  6. includes/mollie-api-php/examples/02-webhook-verification.php +11 -8
  7. includes/mollie-api-php/examples/03-return-page.php +12 -10
  8. includes/mollie-api-php/examples/04-ideal-payment.php +37 -14
  9. includes/mollie-api-php/examples/05-payments-history.php +30 -16
  10. includes/mollie-api-php/examples/06-list-activated-methods.php +4 -6
  11. includes/mollie-api-php/examples/07-refund-payment.php +23 -13
  12. includes/mollie-api-php/examples/08-oauth-list-profiles.php +11 -8
  13. includes/mollie-api-php/examples/09-oauth-list-settlements.php +18 -20
  14. includes/mollie-api-php/examples/10-oauth-new-payment.php +34 -21
  15. includes/mollie-api-php/examples/11-new-customer.php +11 -7
  16. includes/mollie-api-php/examples/12-new-customer-payment.php +29 -17
  17. includes/mollie-api-php/examples/13-customer-payments-history.php +21 -14
  18. includes/mollie-api-php/examples/14-recurring-first-payment.php +23 -16
  19. includes/mollie-api-php/examples/15-recurring-payment.php +24 -17
  20. includes/mollie-api-php/examples/16-recurring-subscription.php +19 -14
  21. includes/mollie-api-php/examples/17-cancel-subscription.php +4 -6
  22. includes/mollie-api-php/examples/18-update-customer.php +6 -7
  23. includes/mollie-api-php/examples/19-update-profile.php +10 -10
  24. includes/mollie-api-php/examples/20-list-invoices.php +15 -15
  25. includes/mollie-api-php/examples/22-create-mandate-subscription.php +27 -16
  26. includes/mollie-api-php/examples/23-delete-customer.php +4 -4
  27. includes/mollie-api-php/examples/24-revoke-mandate.php +7 -4
  28. includes/mollie-api-php/examples/25-update-subscription.php +10 -8
  29. includes/mollie-api-php/examples/initialize.php +5 -6
  30. includes/mollie-api-php/examples/initialize_with_oauth.php +6 -6
  31. includes/mollie-api-php/examples/orders/.gitignore +1 -0
  32. includes/mollie-api-php/src/CompatibilityChecker.php +20 -8
  33. includes/mollie-api-php/src/Endpoints/CustomerEndpoint.php +10 -3
  34. includes/mollie-api-php/src/Endpoints/CustomerPaymentsEndpoint.php +13 -6
  35. includes/mollie-api-php/src/Endpoints/EndpointAbstract.php +75 -31
  36. includes/mollie-api-php/src/Endpoints/InvoiceEndpoint.php +11 -5
  37. includes/mollie-api-php/src/Endpoints/MandateEndpoint.php +19 -8
  38. includes/mollie-api-php/src/Endpoints/MethodEndpoint.php +10 -4
  39. includes/mollie-api-php/src/Endpoints/PaymentEndpoint.php +24 -10
  40. includes/mollie-api-php/src/Endpoints/PaymentRefundEndpoint.php +9 -4
  41. includes/mollie-api-php/src/Endpoints/ProfileEndpoint.php +14 -5
  42. includes/mollie-api-php/src/Endpoints/RefundEndpoint.php +7 -3
  43. includes/mollie-api-php/src/Endpoints/SettlementsEndpoint.php +12 -5
  44. includes/mollie-api-php/src/Endpoints/SubscriptionEndpoint.php +19 -8
  45. includes/mollie-api-php/src/Exceptions/ApiException.php +10 -2
  46. includes/mollie-api-php/src/Exceptions/IncompatiblePlatform.php +1 -1
  47. includes/mollie-api-php/src/MollieApiClient.php +120 -49
  48. includes/mollie-api-php/src/Resources/BaseCollection.php +4 -1
  49. includes/mollie-api-php/src/Resources/BaseResource.php +4 -2
  50. includes/mollie-api-php/src/Resources/Chargeback.php +7 -1
  51. includes/mollie-api-php/src/Resources/ChargebackCollection.php +4 -3
  52. includes/mollie-api-php/src/Resources/CursorCollection.php +24 -10
  53. includes/mollie-api-php/src/Resources/Customer.php +42 -9
  54. includes/mollie-api-php/src/Resources/CustomerCollection.php +4 -3
  55. includes/mollie-api-php/src/Resources/Invoice.php +21 -5
  56. includes/mollie-api-php/src/Resources/InvoiceCollection.php +4 -3
  57. includes/mollie-api-php/src/Resources/Issuer.php +5 -2
  58. includes/mollie-api-php/src/Resources/IssuerCollection.php +2 -2
  59. includes/mollie-api-php/src/Resources/Mandate.php +23 -6
  60. includes/mollie-api-php/src/Resources/MandateCollection.php +4 -3
  61. includes/mollie-api-php/src/Resources/Method.php +9 -3
  62. includes/mollie-api-php/src/Resources/MethodCollection.php +1 -1
  63. includes/mollie-api-php/src/Resources/Payment.php +82 -24
  64. includes/mollie-api-php/src/Resources/PaymentCollection.php +3 -2
  65. includes/mollie-api-php/src/Resources/Profile.php +66 -24
  66. includes/mollie-api-php/src/Resources/ProfileCollection.php +5 -3
  67. includes/mollie-api-php/src/Resources/Refund.php +25 -7
  68. includes/mollie-api-php/src/Resources/RefundCollection.php +3 -2
  69. includes/mollie-api-php/src/Resources/ResourceFactory.php +4 -2
  70. includes/mollie-api-php/src/Resources/Settlement.php +42 -18
  71. includes/mollie-api-php/src/Resources/SettlementCollection.php +4 -3
  72. includes/mollie-api-php/src/Resources/Subscription.php +50 -15
  73. includes/mollie-api-php/src/Resources/SubscriptionCollection.php +5 -3
  74. includes/mollie-api-php/src/Types/InvoiceStatus.php +3 -1
  75. includes/mollie-api-php/src/Types/MandateMethod.php +1 -1
  76. includes/mollie-api-php/src/Types/MandateStatus.php +2 -2
  77. includes/mollie-api-php/src/Types/PaymentMethod.php +15 -0
  78. includes/mollie-api-php/src/Types/PaymentStatus.php +5 -0
  79. includes/mollie-api-php/src/Types/ProfileStatus.php +3 -1
  80. includes/mollie-api-php/src/Types/RefundStatus.php +3 -0
  81. includes/mollie-api-php/src/Types/SettlementStatus.php +3 -0
  82. includes/mollie-api-php/src/Types/SubscriptionStatus.php +5 -7
  83. includes/mollie-api-php/vendor/autoload.php +3 -25
  84. includes/mollie-api-php/vendor/composer-autoload.php +0 -7
  85. includes/mollie-api-php/vendor/composer/autoload_classmap.php +0 -150
  86. includes/mollie-api-php/vendor/composer/autoload_psr4.php +5 -6
  87. includes/mollie-api-php/vendor/composer/autoload_real.php +17 -8
  88. includes/mollie-api-php/vendor/composer/autoload_static.php +23 -176
  89. includes/mollie-api-php/vendor/composer/ca-bundle/composer.json +10 -10
  90. includes/mollie-api-php/vendor/composer/ca-bundle/src/CaBundle.php +120 -72
  91. includes/mollie-api-php/vendor/composer/installed.json +49 -49
  92. includes/mollie-api-php/vendor/guzzlehttp/guzzle/composer.json +13 -23
  93. includes/mollie-api-php/vendor/guzzlehttp/guzzle/src/Client.php +144 -69
  94. includes/mollie-api-php/vendor/guzzlehttp/guzzle/src/ClientInterface.php +13 -12
  95. includes/mollie-api-php/vendor/guzzlehttp/guzzle/src/Cookie/CookieJar.php +119 -50
  96. includes/mollie-api-php/vendor/guzzlehttp/guzzle/src/Cookie/CookieJarInterface.php +14 -6
  97. includes/mollie-api-php/vendor/guzzlehttp/guzzle/src/Cookie/FileCookieJar.php +22 -15
  98. includes/mollie-api-php/vendor/guzzlehttp/guzzle/src/Cookie/SessionCookieJar.php +15 -10
  99. includes/mollie-api-php/vendor/guzzlehttp/guzzle/src/Cookie/SetCookie.php +97 -37
  100. includes/mollie-api-php/vendor/guzzlehttp/guzzle/src/Exception/BadResponseException.php +15 -7
  101. includes/mollie-api-php/vendor/guzzlehttp/guzzle/src/Exception/ClientException.php +2 -5
  102. includes/mollie-api-php/vendor/guzzlehttp/guzzle/src/Exception/ConnectException.php +12 -6
  103. includes/mollie-api-php/vendor/guzzlehttp/guzzle/src/Exception/GuzzleException.php +2 -5
  104. includes/mollie-api-php/vendor/guzzlehttp/guzzle/src/Exception/RequestException.php +74 -22
  105. includes/mollie-api-php/vendor/guzzlehttp/guzzle/src/Exception/SeekException.php +6 -4
  106. includes/mollie-api-php/vendor/guzzlehttp/guzzle/src/Exception/ServerException.php +2 -5
  107. includes/mollie-api-php/vendor/guzzlehttp/guzzle/src/Exception/TooManyRedirectsException.php +2 -5
  108. includes/mollie-api-php/vendor/guzzlehttp/guzzle/src/Exception/TransferException.php +2 -5
  109. includes/mollie-api-php/vendor/guzzlehttp/guzzle/src/Handler/CurlFactory.php +272 -132
  110. includes/mollie-api-php/vendor/guzzlehttp/guzzle/src/Handler/CurlFactoryInterface.php +5 -4
  111. includes/mollie-api-php/vendor/guzzlehttp/guzzle/src/Handler/CurlHandler.php +15 -9
  112. includes/mollie-api-php/vendor/guzzlehttp/guzzle/src/Handler/CurlMultiHandler.php +73 -34
  113. includes/mollie-api-php/vendor/guzzlehttp/guzzle/src/Handler/EasyHandle.php +38 -13
  114. includes/mollie-api-php/vendor/guzzlehttp/guzzle/src/Handler/MockHandler.php +89 -52
  115. includes/mollie-api-php/vendor/guzzlehttp/guzzle/src/Handler/Proxy.php +20 -11
  116. includes/mollie-api-php/vendor/guzzlehttp/guzzle/src/Handler/StreamHandler.php +280 -124
  117. includes/mollie-api-php/vendor/guzzlehttp/guzzle/src/HandlerStack.php +60 -26
  118. includes/mollie-api-php/vendor/guzzlehttp/guzzle/src/MessageFormatter.php +114 -85
  119. includes/mollie-api-php/vendor/guzzlehttp/guzzle/src/Middleware.php +88 -55
  120. includes/mollie-api-php/vendor/guzzlehttp/guzzle/src/Pool.php +37 -20
  121. includes/mollie-api-php/vendor/guzzlehttp/guzzle/src/PrepareBodyMiddleware.php +32 -12
  122. includes/mollie-api-php/vendor/guzzlehttp/guzzle/src/RedirectMiddleware.php +122 -45
  123. includes/mollie-api-php/vendor/guzzlehttp/guzzle/src/RequestOptions.php +29 -2
  124. includes/mollie-api-php/vendor/guzzlehttp/guzzle/src/RetryMiddleware.php +48 -20
  125. includes/mollie-api-php/vendor/guzzlehttp/guzzle/src/TransferStats.php +23 -7
  126. includes/mollie-api-php/vendor/guzzlehttp/guzzle/src/UriTemplate.php +77 -31
  127. includes/mollie-api-php/vendor/guzzlehttp/guzzle/src/functions.php +92 -53
  128. includes/mollie-api-php/vendor/guzzlehttp/guzzle/src/functions_include.php +1 -3
  129. includes/mollie-api-php/vendor/guzzlehttp/promises/composer.json +9 -13
  130. includes/mollie-api-php/vendor/guzzlehttp/promises/src/AggregateException.php +6 -4
  131. includes/mollie-api-php/vendor/guzzlehttp/promises/src/CancellationException.php +2 -3
  132. includes/mollie-api-php/vendor/guzzlehttp/promises/src/Coroutine.php +28 -12
  133. includes/mollie-api-php/vendor/guzzlehttp/promises/src/EachPromise.php +77 -38
  134. includes/mollie-api-php/vendor/guzzlehttp/promises/src/FulfilledPromise.php +23 -10
  135. includes/mollie-api-php/vendor/guzzlehttp/promises/src/Promise.php +81 -32
  136. includes/mollie-api-php/vendor/guzzlehttp/promises/src/PromiseInterface.php +13 -4
  137. includes/mollie-api-php/vendor/guzzlehttp/promises/src/PromisorInterface.php +1 -2
  138. includes/mollie-api-php/vendor/guzzlehttp/promises/src/RejectedPromise.php +23 -10
  139. includes/mollie-api-php/vendor/guzzlehttp/promises/src/RejectionException.php +11 -4
  140. includes/mollie-api-php/vendor/guzzlehttp/promises/src/TaskQueue.php +14 -10
  141. includes/mollie-api-php/vendor/guzzlehttp/promises/src/TaskQueueInterface.php +3 -2
  142. includes/mollie-api-php/vendor/guzzlehttp/promises/src/functions.php +140 -70
  143. includes/mollie-api-php/vendor/guzzlehttp/promises/src/functions_include.php +1 -3
  144. includes/mollie-api-php/vendor/guzzlehttp/psr7/composer.json +10 -20
  145. includes/mollie-api-php/vendor/guzzlehttp/psr7/src/AppendStream.php +58 -21
  146. includes/mollie-api-php/vendor/guzzlehttp/psr7/src/BufferStream.php +37 -15
  147. includes/mollie-api-php/vendor/guzzlehttp/psr7/src/CachingStream.php +41 -18
  148. includes/mollie-api-php/vendor/guzzlehttp/psr7/src/DroppingStream.php +12 -6
  149. includes/mollie-api-php/vendor/guzzlehttp/psr7/src/FnStream.php +49 -24
  150. includes/mollie-api-php/vendor/guzzlehttp/psr7/src/InflateStream.php +15 -11
  151. includes/mollie-api-php/vendor/guzzlehttp/psr7/src/LazyOpenStream.php +7 -3
  152. includes/mollie-api-php/vendor/guzzlehttp/psr7/src/LimitStream.php +41 -14
  153. includes/mollie-api-php/vendor/guzzlehttp/psr7/src/MessageTrait.php +51 -18
  154. includes/mollie-api-php/vendor/guzzlehttp/psr7/src/MultipartStream.php +45 -15
  155. includes/mollie-api-php/vendor/guzzlehttp/psr7/src/NoSeekStream.php +7 -5
  156. includes/mollie-api-php/vendor/guzzlehttp/psr7/src/PumpStream.php +39 -14
  157. includes/mollie-api-php/vendor/guzzlehttp/psr7/src/Request.php +45 -15
  158. includes/mollie-api-php/vendor/guzzlehttp/psr7/src/Response.php +81 -7
  159. includes/mollie-api-php/vendor/guzzlehttp/psr7/src/ServerRequest.php +101 -32
  160. includes/mollie-api-php/vendor/guzzlehttp/psr7/src/Stream.php +84 -27
  161. includes/mollie-api-php/vendor/guzzlehttp/psr7/src/StreamDecoratorTrait.php +28 -7
  162. includes/mollie-api-php/vendor/guzzlehttp/psr7/src/StreamWrapper.php +52 -13
  163. includes/mollie-api-php/vendor/guzzlehttp/psr7/src/UploadedFile.php +111 -39
  164. includes/mollie-api-php/vendor/guzzlehttp/psr7/src/Uri.php +205 -58
  165. includes/mollie-api-php/vendor/guzzlehttp/psr7/src/UriNormalizer.php +55 -18
  166. includes/mollie-api-php/vendor/guzzlehttp/psr7/src/UriResolver.php +54 -25
  167. includes/mollie-api-php/vendor/guzzlehttp/psr7/src/functions.php +324 -110
  168. includes/mollie-api-php/vendor/guzzlehttp/psr7/src/functions_include.php +1 -3
  169. includes/mollie-api-php/vendor/psr/http-message/composer.json +6 -13
  170. includes/mollie-api-php/vendor/psr/http-message/src/MessageInterface.php +12 -2
  171. includes/mollie-api-php/vendor/psr/http-message/src/RequestInterface.php +8 -3
  172. includes/mollie-api-php/vendor/psr/http-message/src/ResponseInterface.php +4 -2
  173. includes/mollie-api-php/vendor/psr/http-message/src/ServerRequestInterface.php +14 -2
  174. includes/mollie-api-php/vendor/psr/http-message/src/StreamInterface.php +16 -2
  175. includes/mollie-api-php/vendor/psr/http-message/src/UploadedFileInterface.php +6 -1
  176. includes/mollie-api-php/vendor/psr/http-message/src/UriInterface.php +16 -2
  177. includes/mollie/wc/plugin.php +1 -1
  178. mollie-payments-for-woocommerce.php +1 -1
  179. readme.txt +5 -1
assets/images/creditcards-all.svg ADDED
@@ -0,0 +1,54 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?xml version="1.0" encoding="UTF-8" standalone="no"?>
2
+ <svg width="171px" height="24px" viewBox="0 0 171 24" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
3
+ <!-- Generator: Sketch 50.2 (55047) - http://www.bohemiancoding.com/sketch -->
4
+ <title>Slice 1</title>
5
+ <desc>Created with Sketch.</desc>
6
+ <defs>
7
+ <linearGradient x1="150%" y1="50%" x2="50.0000751%" y2="149.999925%" id="linearGradient-1">
8
+ <stop stop-color="#083969" offset="0%"></stop>
9
+ <stop stop-color="#007B9D" offset="49.1699%"></stop>
10
+ <stop stop-color="#00A84A" offset="100%"></stop>
11
+ </linearGradient>
12
+ <rect id="path-2" x="0" y="0" width="31" height="34" rx="8"></rect>
13
+ </defs>
14
+ <g id="Page-1" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd">
15
+ <g id="carte-bancaire" transform="translate(140.000000, 0.000000)">
16
+ <path d="M27.125,0 L3.875,0 C1.73489562,0 0,1.79086 0,4 L0,20 C0,22.2091 1.73489562,24 3.875,24 L27.125,24 C29.2650656,24 31,22.2091 31,20 L31,4 C31,1.79086 29.2650656,0 27.125,0 Z" id="Shape" fill="url(#linearGradient-1)" fill-rule="nonzero"></path>
17
+ <path d="M23.4848485,9.69228267 C23.4848485,10.6257093 22.7325818,11.3827267 21.8039909,11.3843413 L21.8039909,11.3861707 L15.6780245,11.3861707 L15.6780245,8 L21.8039909,8 L21.8039909,8.00032221 C22.7325818,8.00182637 23.4848485,8.7588448 23.4848485,9.69228267 Z M23.4848485,13.283544 C23.4848485,14.2171947 22.7325818,14.9739973 21.8039909,14.9755 L21.8039909,14.977656 L15.6780245,14.977656 L15.6780245,11.5913733 L21.8039909,11.5913733 L21.8039909,11.591588 C22.7325818,11.5932027 23.4848485,12.3501173 23.4848485,13.283544 Z M11.0621058,11.5913733 L15.5601118,11.5913733 L15.5601118,11.9217547 C15.5601118,13.6217653 14.1889818,15 12.4973682,15 L9.63882061,15 C7.94719758,15 6.57575758,13.6217653 6.57575758,11.9217547 L6.57575758,11.1008133 C6.57575758,9.40069067 7.94719758,8.02256212 9.63882061,8.02256212 L12.4973682,8.02256212 C14.1889818,8.02256212 15.5601118,9.40069067 15.5601118,11.1008133 L15.5601118,11.3861707 L11.0621058,11.3861707 L11.0621058,11.5913733 Z" id="Shape" fill="#FFFFFF"></path>
18
+ </g>
19
+ <g id="cartasi" transform="translate(105.000000, 0.000000)">
20
+ <path d="M3.875,0 L27.125,0 C29.2650656,0 31,1.79086 31,4 L31,20 C31,22.2091 29.2650656,24 27.125,24 L3.875,24 C1.73489562,24 0,22.2091 0,20 L0,4 C0,1.79086 1.73489562,0 3.875,0 Z" id="Shape" fill="#FF6E28"></path>
21
+ <path d="M14.4639264,6.08572158 C14.6640268,6.02713265 14.8722248,6 15.0797183,6 L15.0942695,6 C15.3636502,6.00169188 15.6161125,6.04956571 15.8340708,6.13196578 C16.0101509,6.19857591 16.1636198,6.28780693 16.2854405,6.39351742 C16.336149,6.43744311 16.3833066,6.48688347 16.4247151,6.54083529 C16.4550106,6.58024951 16.4821685,6.6220456 16.5053057,6.66603387 C16.5681324,6.78553102 16.6007388,6.92031671 16.5841115,7.063128 C16.57127,7.17303022 16.530923,7.27792622 16.4676172,7.37474578 C16.4194545,7.448304 16.3581026,7.517296 16.2854405,7.58033333 C16.2282313,7.62996533 16.1640989,7.67596 16.0938697,7.71769156 C15.8268563,7.87415556 15.47417,7.96934222 15.0875246,7.96934222 C14.2543099,7.96934222 13.5788195,7.52744533 13.5788195,6.98241244 C13.5788195,6.69391911 13.7680324,6.43437289 14.0696532,6.2539064 C14.0979383,6.23717564 14.1272193,6.2211968 14.1573926,6.20590729 C14.2514072,6.1583472 14.354177,6.1178672 14.4639264,6.08572158 Z M9.60109177,11.9841564 C9.60109177,9.78559378 13.2885561,9.03910933 15.1626104,9.03910933 C16.2224916,9.03910933 18.4683959,9.276152 19.8289209,10.5124151 C20.0043059,10.6757138 20.1642848,10.8561138 20.3044424,11.0553164 C20.3415485,11.10796 20.3771515,11.161904 20.4112516,11.2171778 C20.4933546,11.3500773 20.5670032,11.4906916 20.630882,11.6395778 C20.6872457,11.7709813 20.6721214,11.8662267 20.6196093,11.9179902 C20.6111547,11.9263209 20.6017608,11.9335271 20.5915214,11.9396089 C20.5690698,11.9528871 20.5425789,11.9606018 20.5136456,11.9624791 C20.4284425,11.967808 20.3516,11.9276409 20.2876273,11.8709298 C20.2750394,11.8575831 20.2627333,11.8431707 20.250709,11.8275653 C20.1895545,11.7477982 20.1164696,11.6700356 20.0327695,11.5945218 C19.3371479,10.9390782 17.845568,10.4527609 16.4789745,10.3892249 C14.9899685,10.3199787 13.6494056,10.7527236 13.6494056,12.0156116 L13.6494056,13.6447653 C13.6494056,13.7235253 13.6470947,13.7969076 13.6424259,13.8650782 C13.6114165,14.3182587 13.4765195,14.5449662 13.2235312,14.6342569 C13.1056184,14.6759298 12.9620789,14.687712 12.791513,14.6787458 C12.3282507,14.654184 11.1490852,14.4173858 10.3525444,13.7010951 C10.3507126,13.699472 10.3488808,13.6978391 10.3471053,13.6962062 C9.91235919,13.2897831 9.60109177,12.734288 9.60109177,11.9841564 Z M16.6125094,11.5236524 C16.7363404,11.380848 16.9192217,11.3262684 17.166414,11.3262684 C17.1994901,11.3262684 17.2336277,11.3272071 17.2690053,11.3290844 C17.9970923,11.3676871 20.4936365,11.9305156 20.4936365,14.0549529 C20.4936365,16.2534667 16.8060998,17 14.9320455,17 C13.6008296,17 10.3987532,16.626 9.42975007,14.3681938 C9.28177844,14.0235564 9.62635585,13.9279982 9.84384633,14.211544 C10.839301,15.509016 15.0057034,16.2934578 16.1303089,14.8543938 C16.1352219,14.8484978 16.1401349,14.8424258 16.1449822,14.8364711 C16.1816656,14.7907307 16.2152771,14.7427316 16.2455068,14.6924053 C16.3681541,14.4882551 16.4363166,14.245688 16.4363166,13.9608907 L16.4363166,12.3317467 C16.4363166,11.9411049 16.4931124,11.6840667 16.6125094,11.5236524 Z" id="Shape" fill="#FFFFFF"></path>
22
+ </g>
23
+ <g id="amex" transform="translate(70.000000, -4.000000)">
24
+ <path d="M3.62903,4 L27.371,4 C29.3701,4 31,5.71105391 31,7.83364522 L31,24.1663652 C31,26.2889043 29.3701,28 27.371,28 L3.62903,28 C1.62986,28 0,26.2889043 0,24.1663652 L0,7.83364522 C0,5.71105391 1.62986,4 3.62903,4 Z" id="Shape" fill="#0095FF" fill-rule="nonzero"></path>
25
+ <g id="Clipped">
26
+ <g id="Group-Clipped">
27
+ <mask id="mask-3" fill="white">
28
+ <use xlink:href="#path-2"></use>
29
+ </mask>
30
+ <g id="path-3"></g>
31
+ <g id="Group" mask="url(#mask-3)">
32
+ <g transform="translate(-1.937500, 9.562500)">
33
+ <g>
34
+ <g transform="translate(0.745938, 0.898875)" fill="#FFFFFF" fill-rule="nonzero" id="Shape">
35
+ <path d="M3.02304965,3.17401046 L2.3254228,1.52352502 L1.7440671,3.17401046 L3.02304965,3.17401046 Z M16.7430442,2.41224795 C16.6628492,2.5365533 16.5148678,2.53920837 16.3942307,2.53920837 L15.2315194,2.53920837 L15.2315194,1.65048544 L16.3942307,1.65048544 C16.5113061,1.65048544 16.6768662,1.65796789 16.7430442,1.77744586 C16.9025149,1.78094571 16.9755864,1.90500969 16.9755864,2.03136669 C16.9755864,2.25125441 16.9060766,2.3919729 16.7430442,2.41224795 Z M24.882024,3.17401046 L24.1843972,1.52352502 L23.6030415,3.17401046 L24.882024,3.17401046 Z M9.99931805,5.07841673 L9.06914894,5.07841673 L9.06914894,1.77744586 L7.67389525,5.07841673 L6.85999728,5.07841673 L5.58101473,1.77744586 L5.58101473,5.07841673 L3.60440535,5.07841673 L3.25559193,4.1896938 L1.39525369,4.1896938 L1.04644026,5.07841673 L0,5.07841673 L1.62779596,0.888722927 L3.02304965,0.888722927 L4.65084561,4.8244959 L4.65084561,0.888722927 L6.16237043,0.888722927 L7.32508184,3.68185213 L8.48779324,0.888722927 L9.99931805,0.888722927 L9.99931805,5.07841673 Z M13.7199945,5.07841673 L10.6969449,5.07841673 L10.6969449,0.888722927 L13.7199945,0.888722927 L13.7199945,1.77744586 L11.627114,1.77744586 L11.627114,2.53920837 L13.7199945,2.53920837 L13.7199945,3.42793129 L11.627114,3.42793129 L11.627114,4.1896938 L13.7199945,4.1896938 L13.7199945,5.07841673 Z M18.1382979,2.03136669 C18.1382979,2.68508227 17.7259413,3.03020062 17.440671,3.17401046 C17.6883056,3.21722923 17.8614065,3.36457745 17.9057556,3.42793129 C18.0745977,3.69503681 18.0971557,3.88118082 18.1382979,4.31665422 L18.1382979,5.07841673 L17.2081288,5.07841673 L17.2081288,4.57057506 C17.1594186,4.29795136 17.1817428,3.93539386 16.9755864,3.68185213 C16.877852,3.58648438 16.6715567,3.5545126 16.3942307,3.55489171 L15.3477905,3.55489171 L15.3477905,5.07841673 L14.4176213,5.07841673 L14.4176213,0.888722927 L16.5105019,0.888722927 C17.021382,0.888722927 17.3701552,0.902244591 17.6732133,1.14264376 C17.9626256,1.27655457 18.1382979,1.54976799 18.1382979,2.03136669 Z M19.5335515,5.07841673 L18.6033824,5.07841673 L18.6033824,0.888722927 L19.5335515,0.888722927 L19.5335515,5.07841673 Z M30.4630387,5.07841673 L29.1840562,5.07841673 L27.4399891,1.90440627 L27.4399891,5.07841673 L25.5796509,5.07841673 L25.1145663,4.1896938 L23.254228,4.1896938 L22.9054147,5.07841673 L21.8589744,5.07841673 C21.3802594,5.07841673 20.8127383,4.9707489 20.4637207,4.57057506 C20.1672516,4.25928193 19.9986361,3.77743049 19.9986361,3.04705004 C19.9986361,2.39417694 20.0994097,1.82614069 20.4637207,1.3965646 C20.793887,1.04289517 21.2607506,0.888722927 21.8589744,0.888722927 L22.7891434,0.888722927 L22.7891434,1.77744586 L21.8589744,1.77744586 C21.578432,1.7864603 21.388405,1.8407997 21.1613475,2.03136669 C21.0481485,2.21106582 20.9402764,2.54455806 20.9288052,3.04705004 C20.9402764,3.43256488 21.0224314,3.75620021 21.1613475,3.93577297 C21.3358073,4.13341672 21.5937924,4.18371225 21.8589744,4.1896938 L22.2077877,4.1896938 L23.6030415,0.888722927 L24.882024,0.888722927 L26.50982,4.8244959 L26.50982,0.888722927 L27.9050736,0.888722927 L29.5328696,3.80881255 L29.5328696,0.888722927 L30.4630387,0.888722927 L30.4630387,5.07841673 Z M0,5.84017923 L1.62779596,5.84017923 L1.97660939,4.95145631 L2.67423623,4.95145631 L3.02304965,5.84017923 L6.16237043,5.84017923 L6.16237043,5.07841673 L6.51118385,5.84017923 L8.02270868,5.84017923 L8.37152209,5.07841673 L8.37152209,5.84017923 L16.0454174,5.84017923 L16.0454174,4.31665422 L16.1616885,4.31665422 C16.2952536,4.31512292 16.3257367,4.32560051 16.2779596,4.57057506 L16.2779596,5.84017923 L20.3474496,5.84017923 L20.3474496,5.45929799 C20.6311992,5.66875084 21.1310308,5.83714958 21.7427032,5.84017923 L23.4867703,5.84017923 L23.8355837,4.95145631 L24.6494817,4.95145631 L24.9982952,5.84017923 L28.2538871,5.84017923 L28.2538871,4.95145631 L28.7189717,5.84017923 L31.2769368,5.84017923 L31.2769368,0 L28.7189717,0 L28.7189717,0.634802091 L28.3701582,0 L25.695922,0 L25.695922,0.634802091 L25.3471085,0 L21.8589744,0 C21.2542435,0 20.7318404,0.0900062208 20.3474496,0.380881255 L20.3474496,0 L17.9057556,0 L17.9057556,0.380881255 C17.5912554,0.0823058288 17.2253405,0 16.8593153,0 L7.90643754,0 L7.20881069,1.52352502 L6.62745499,0 L3.83694763,0 L3.83694763,0.634802091 L3.4881342,0 L1.1627114,0 L0,2.7931292 L0,5.84017923 Z M33.0585277,8.15244586 L31.3144606,8.15244586 C31.192706,8.15244586 31.0801811,8.15898494 30.9656472,8.27940627 C30.8871975,8.29000873 30.849376,8.38652072 30.849376,8.53332711 C30.849376,8.66540038 30.9323014,8.76845145 31.0819183,8.78724795 C31.1511259,8.84825246 31.2566032,8.85854545 31.4307317,8.91420837 L31.8958163,8.91420837 C32.4251937,8.88542833 32.7649999,8.97564342 32.9422566,9.1681292 C33.0099,9.22630818 33.0325694,9.2606989 33.0585277,9.29508962 L33.0585277,8.15244586 Z M33.0585277,10.8186146 C32.8345848,11.2106357 32.3982163,11.3906536 31.7795452,11.4534167 L30.035478,11.4534167 L30.035478,10.4377334 L31.7795452,10.4377334 C31.9761567,10.493591 32.099238,10.4684869 32.1283585,10.4377334 C32.237559,10.3253051 32.2823476,10.2313223 32.2446298,10.0568521 C32.2823476,9.99529298 32.237559,9.89853486 32.1283585,9.80293129 C32.1028444,9.7766726 32.0054729,9.74765778 31.8958163,9.80293129 C30.9792912,9.71574147 29.8993632,9.7766726 29.9192069,8.40636669 C29.8993632,7.84605152 30.254647,7.20734697 31.1981895,7.26372293 L33.0585277,7.26372293 L33.0585277,6.375 L31.3144606,6.375 C30.8373637,6.375 30.4633502,6.50872049 30.1517492,6.75588125 L30.1517492,6.375 L27.7100553,6.375 C27.2712631,6.375 26.7975514,6.48349021 26.5473439,6.75588125 L26.5473439,6.375 L22.0127694,6.375 L22.0127694,6.75588125 C21.7082905,6.43605727 21.1031214,6.375 20.850058,6.375 L17.8270083,6.375 L17.8270083,6.75588125 C17.5675002,6.41864838 16.9365049,6.375 16.5480258,6.375 L13.1761627,6.375 L12.4785359,7.26372293 L11.7809091,6.375 L6.78125,6.375 L6.78125,12.2151793 L11.6646379,12.2151793 L12.4785359,11.3264563 L13.1761627,12.2151793 L16.1992124,12.2151793 L16.1992124,10.8186146 L16.4317546,10.8186146 C16.8805483,10.8487072 17.3508865,10.8312983 17.7107372,10.6916542 L17.7107372,12.2151793 L20.2687023,12.2151793 L20.2687023,10.6916542 L20.3849734,10.6916542 C20.5171473,10.6907657 20.5321543,10.6975779 20.5012445,10.8186146 L20.5012445,12.2151793 L28.0588687,12.2151793 C28.5412808,12.2120254 29.0410514,12.0793142 29.3378512,11.834298 L29.3378512,12.2151793 L31.663274,12.2151793 C32.2037059,12.2120254 32.6891674,12.1364608 33.0585277,11.9612584 L33.0585277,10.8186146 Z M29.4541223,9.29508962 C29.5899045,9.44543134 29.6866647,9.70014086 29.6866647,10.1838125 C29.6866647,11.0326911 29.1651894,11.4534167 28.1751398,11.4534167 L26.4310727,11.4534167 L26.4310727,10.5646938 L28.1751398,10.5646938 C28.3987133,10.5549845 28.5234368,10.529842 28.6402244,10.4377334 C28.6653595,10.3864415 28.7111071,10.2923152 28.7564955,10.1838125 C28.7111071,10.0559256 28.6616155,9.95901975 28.6402244,9.92989171 C28.5270638,9.83697143 28.4292507,9.80791231 28.2914109,9.80293129 C27.4006914,9.77594727 26.3148015,9.83697143 26.3148015,8.53332711 C26.3148015,7.90340266 26.6683798,7.26372293 27.5937841,7.26372293 L29.4541223,7.26372293 L29.4541223,8.15244586 L27.8263264,8.15244586 C27.6297802,8.15545897 27.5201498,8.16228155 27.4775129,8.27940627 C27.3253425,8.29898576 27.2876681,8.39968195 27.2449707,8.53332711 C27.2876681,8.69065221 27.3738981,8.79817096 27.4775129,8.78724795 C27.5883616,8.88143167 27.693429,8.89217091 27.8263264,8.91420837 L28.4076821,8.91420837 C28.8538487,8.91996659 29.1993539,9.01396654 29.4541223,9.29508962 Z M20.9663291,8.78724795 C20.8885673,8.90776488 20.7379534,8.91420837 20.6175157,8.91420837 L19.4548043,8.91420837 L19.4548043,8.02548544 L20.6175157,8.02548544 C20.7379534,8.02548544 20.9001707,8.02906515 20.9663291,8.15244586 C21.1283321,8.16103716 21.1988713,8.2835826 21.1988713,8.40636669 C21.1988713,8.62222326 21.1283321,8.75861026 20.9663291,8.78724795 Z M21.5476848,9.54901046 C21.795985,9.58863533 21.9641472,9.73607436 22.0127694,9.80293129 C22.1734754,10.0626638 22.1923674,10.2535638 22.2453116,10.5646938 L22.2453116,11.4534167 L21.3151426,11.4534167 L21.3151426,10.9455751 C21.2682915,10.6771826 21.290682,10.3039736 21.0826002,10.0568521 C20.9838618,9.95906481 20.7780322,9.9231842 20.3849734,9.92989171 L19.4548043,9.92989171 L19.4548043,11.4534167 L18.5246351,11.4534167 L18.5246351,7.26372293 L20.6175156,7.26372293 C21.126135,7.26372293 21.4668908,7.28608514 21.7802271,7.51764376 C22.0618726,7.65234539 22.2453116,7.91386961 22.2453116,8.40636669 C22.2451951,9.06053329 21.8335358,9.40177817 21.5476848,9.54901046 Z M22.8266674,7.26372293 L25.849717,7.26372293 L25.849717,8.15244586 L23.7568364,8.15244586 L23.7568364,8.91420837 L25.849717,8.91420837 L25.849717,9.80293129 L23.7568364,9.80293129 L23.7568364,10.5646938 L25.849717,10.5646938 L25.849717,11.4534167 L22.8266674,11.4534167 L22.8266674,7.26372293 Z M16.5480258,9.04116878 L15.3853143,9.04116878 L15.3853143,8.02548544 L16.5480258,8.02548544 C16.9012051,8.02548544 17.1293815,8.1657207 17.1293815,8.53332711 C17.1293815,8.85944024 16.9117753,9.04116878 16.5480258,9.04116878 Z M14.4551453,10.9455751 L13.0598916,9.29508962 L14.4551453,7.64460418 L14.4551453,10.9455751 Z M10.8507399,10.4377334 L8.5253171,10.4377334 L8.5253171,9.67597088 L10.6181976,9.67597088 L10.6181976,8.78724795 L8.5253171,8.78724795 L8.5253171,8.02548544 L10.8507399,8.02548544 L11.8971802,9.1681292 L10.8507399,10.4377334 Z M18.0595506,8.66028753 C18.0595506,9.80783558 17.263779,10.0481347 16.4317546,10.0568521 L15.2690432,10.0568521 L15.2690432,11.4534167 L13.5249761,11.4534167 L12.3622648,10.0568521 L11.1995533,11.4534167 L7.59514799,11.4534167 L7.59514799,7.26372293 L11.3158245,7.26372293 L12.3622648,8.66028753 L13.5249761,7.26372293 L16.5480258,7.26372293 C17.241433,7.26372293 18.0595506,7.48368122 18.0595506,8.66028753 Z"></path>
36
+ </g>
37
+ </g>
38
+ </g>
39
+ </g>
40
+ </g>
41
+ </g>
42
+ </g>
43
+ <g id="mastercard" transform="translate(35.000000, 0.000000)">
44
+ <path d="M3.62903,0.5 L27.371,0.5 C29.3701,0.5 31,2.13976 31,4.17391 L31,19.8261 C31,21.8602 29.3701,23.5 27.371,23.5 L3.62903,23.5 C1.62986,23.5 0,21.8602 0,19.8261 L0,4.17391 C0,2.13976 1.62986,0.5 3.62903,0.5 Z" id="Shape" stroke="#E5E5E5" fill="#FFFFFF" fill-rule="nonzero"></path>
45
+ <path d="M12.40323,17.21739 C15.25373,17.21739 17.56454,14.88147 17.56454,11.99998 C17.56454,9.1185 15.25373,6.78259 12.40323,6.78259 C9.55273,6.78259 7.24194,9.1185 7.24194,11.99998 C7.24194,14.88147 9.55273,17.21739 12.40323,17.21739 Z" id="Shape" fill="#E7001A" fill-rule="nonzero"></path>
46
+ <path d="M18.59679,17.21739 C21.44729,17.21739 23.7581,14.88147 23.7581,11.99998 C23.7581,9.1185 21.44729,6.78259 18.59679,6.78259 C15.74629,6.78259 13.4355,9.1185 13.4355,11.99998 C13.4355,14.88147 15.74629,17.21739 18.59679,17.21739 Z" id="Shape" fill="#F49B1C" fill-rule="nonzero"></path>
47
+ <path d="M15.50002,7.82568 C16.75364,8.777547 17.56453,10.29303 17.56453,11.99997 C17.56453,13.70692 16.75364,15.2224 15.50002,16.17427 C14.246394,15.2224 13.4355,13.70692 13.4355,11.99997 C13.4355,10.29303 14.246394,8.777547 15.50002,7.82568 Z" id="Shape" fill="#E7001A" opacity="0.3"></path>
48
+ </g>
49
+ <g id="visa" fill-rule="nonzero">
50
+ <path d="M27.125,0 L3.875,0 C1.73489562,0 0,1.79086 0,4 L0,20 C0,22.2091 1.73489562,24 3.875,24 L27.125,24 C29.2650656,24 31,22.2091 31,20 L31,4 C31,1.79086 29.2650656,0 27.125,0 Z" id="Shape" fill="#27337A"></path>
51
+ <path d="M15.7919939,13.08183 C15.7822944,12.24605 16.4734389,11.77962 16.9942056,11.50233 C17.5291389,11.21778 17.7088667,11.03534 17.7067889,10.78092 C17.7027278,10.39148 17.2800889,10.21964 16.8844611,10.21294 C16.1942517,10.20123 15.7930139,10.41659 15.4739617,10.5795 L15.225365,9.307979 C15.5454372,9.146736 16.138095,9.00613725 16.7527111,9 C18.19535,9 19.1392278,9.778315 19.1443278,10.98512 C19.1499,12.51664 17.2060444,12.60145 17.2192667,13.28603 C17.2238944,13.49358 17.4051333,13.71508 17.8022722,13.77143 C17.9988111,13.79989 18.5413944,13.82165 19.1566056,13.512 L19.3980056,14.74224 C19.0672611,14.87391 18.6419778,15 18.1126167,15 C16.7547889,15 15.7996533,14.21108 15.7919939,13.08183 Z M21.7181278,14.89399 C21.4547222,14.89399 21.2326833,14.72606 21.1336111,14.46829 L19.0728333,9.0903854 L20.5144333,9.0903854 L20.8013556,9.956853 L22.5630278,9.956853 L22.7294389,9.0903854 L24,9.0903854 L22.8912222,14.89399 L21.7181278,14.89399 Z M21.9197667,13.3262 L22.3357944,11.14692 L21.1964167,11.14692 L21.9197667,13.3262 Z M14.0441106,14.89399 L12.9077833,9.0903854 L14.2814872,9.0903854 L15.4173044,14.89399 L14.0441106,14.89399 Z M12.0118928,14.89399 L10.5820417,10.94384 L10.0036639,14.30258 C9.93576778,14.67751 9.66776278,14.89399 9.37015889,14.89399 L7.03267079,14.89399 L7,14.7255 C7.47985144,14.61168 8.02504333,14.42812 8.355325,14.23173 C8.55747389,14.11177 8.61516056,14.00688 8.68151722,13.72178 L9.77700667,9.0903854 L11.2288161,9.0903854 L13.4545033,14.89399 L12.0118928,14.89399 Z" id="Shape" fill="#FFFFFF" transform="translate(15.500000, 12.000000) scale(-1, 1) rotate(-180.000000) translate(-15.500000, -12.000000) "></path>
52
+ </g>
53
+ </g>
54
+ </svg>
assets/images/creditcards.svg CHANGED
@@ -1,38 +1,25 @@
1
  <?xml version="1.0" encoding="UTF-8" standalone="no"?>
2
- <svg width="174px" height="32px" viewBox="0 0 174 32" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
3
  <!-- Generator: Sketch 50.2 (55047) - http://www.bohemiancoding.com/sketch -->
4
  <title>Slice 1</title>
5
  <desc>Created with Sketch.</desc>
6
  <defs>
7
- <linearGradient x1="150%" y1="50%" x2="50.0000751%" y2="149.999925%" id="linearGradient-1">
8
- <stop stop-color="#083969" offset="0%"></stop>
9
- <stop stop-color="#007B9D" offset="49.1699%"></stop>
10
- <stop stop-color="#00A84A" offset="100%"></stop>
11
- </linearGradient>
12
- <rect id="path-2" x="0" y="0" width="31" height="32" rx="8"></rect>
13
  </defs>
14
  <g id="Page-1" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd">
15
- <g id="carte-bancaire" transform="translate(142.000000, 2.000000)">
16
- <path d="M28,0.5 L4,0.5 C1.79086,0.5 0,2.29086 0,4.5 L0,20.5 C0,22.7091 1.79086,24.5 4,24.5 L28,24.5 C30.2091,24.5 32,22.7091 32,20.5 L32,4.5 C32,2.29086 30.2091,0.5 28,0.5 Z" id="Shape" fill="url(#linearGradient-1)" fill-rule="nonzero"></path>
17
- <path d="M25,10.56316 C25,11.56326 24.1992,12.37435 23.2107,12.37608 L23.2107,12.37804 L16.68951,12.37804 L16.68951,8.75 L23.2107,8.75 L23.2107,8.75034523 C24.1992,8.75195682 25,9.563048 25,10.56316 Z M25,14.41094 C25,15.41128 24.1992,16.22214 23.2107,16.22375 L23.2107,16.22606 L16.68951,16.22606 L16.68951,12.5979 L23.2107,12.5979 L23.2107,12.59813 C24.1992,12.59986 25,13.41084 25,14.41094 Z M11.77579,12.5979 L16.56399,12.5979 L16.56399,12.95188 C16.56399,14.77332 15.1044,16.25 13.30365,16.25 L10.26068,16.25 C8.45992,16.25 7,14.77332 7,12.95188 L7,12.0723 C7,10.25074 8.45992,8.7741737 10.26068,8.7741737 L13.30365,8.7741737 C15.1044,8.7741737 16.56399,10.25074 16.56399,12.0723 L16.56399,12.37804 L11.77579,12.37804 L11.77579,12.5979 Z" id="Shape" fill="#FFFFFF"></path>
18
- </g>
19
- <g id="cartasi" transform="translate(106.000000, 2.000000)">
20
- <path d="M4,0.5 L28,0.5 C30.2091,0.5 32,2.29086 32,4.5 L32,20.5 C32,22.7091 30.2091,24.5 28,24.5 L4,24.5 C1.79086,24.5 0,22.7091 0,20.5 L0,4.5 C0,2.29086 1.79086,0.5 4,0.5 Z" id="Shape" fill="#FF6E28"></path>
21
- <path d="M15.39708,6.5876698 C15.61009,6.5277493 15.83172,6.5 16.0526,6.5 L16.06809,6.5 C16.35485,6.50173033 16.6236,6.5506922 16.85562,6.634965 C17.04306,6.703089 17.20643,6.794348 17.33611,6.902461 C17.39009,6.947385 17.44029,6.997949 17.48437,7.053127 C17.51662,7.093437 17.54553,7.136183 17.57016,7.181171 C17.63704,7.303384 17.67175,7.441233 17.65405,7.58729 C17.64038,7.69969 17.59743,7.80697 17.53004,7.90599 C17.47877,7.98122 17.41346,8.05178 17.33611,8.11625 C17.27521,8.16701 17.20694,8.21405 17.13218,8.25673 C16.84794,8.41675 16.4725,8.5141 16.06091,8.5141 C15.17394,8.5141 14.45487,8.06216 14.45487,7.50474 C14.45487,7.20969 14.65629,6.944245 14.97737,6.759677 C15.00748,6.742566 15.03865,6.726224 15.07077,6.710587 C15.17085,6.661946 15.28025,6.620546 15.39708,6.5876698 Z M10.220517,12.62016 C10.220517,10.37163 14.14588,9.60818 16.14084,9.60818 C17.2691,9.60818 19.6599,9.85061 21.1082,11.11497 C21.2949,11.28198 21.4652,11.46648 21.6144,11.67021 C21.6539,11.72405 21.6918,11.77922 21.7281,11.83575 C21.8155,11.97167 21.8939,12.11548 21.9619,12.26775 C22.0219,12.40214 22.0058,12.49955 21.9499,12.55249 C21.9409,12.56101 21.9309,12.56838 21.92,12.5746 C21.8961,12.58818 21.8679,12.59607 21.8371,12.59799 C21.7464,12.60344 21.6646,12.56236 21.5965,12.50436 C21.5831,12.49071 21.57,12.47597 21.5572,12.46001 C21.4921,12.37843 21.4143,12.2989 21.3252,12.22167 C20.5847,11.55133 18.99689,11.05396 17.54213,10.98898 C15.95706,10.91816 14.53001,11.36074 14.53001,12.65233 L14.53001,14.31851 C14.53001,14.39906 14.52755,14.47411 14.52258,14.54383 C14.48957,15.00731 14.34597,15.23917 14.07666,15.33049 C13.95114,15.37311 13.79834,15.38516 13.61677,15.37599 C13.12362,15.35087 11.86838,15.10869 11.02045,14.37612 C11.0185,14.37446 11.01655,14.37279 11.01466,14.37112 C10.551866,13.95546 10.220517,13.38734 10.220517,12.62016 Z M17.68428,12.14919 C17.8161,12.00314 18.01078,11.94732 18.27392,11.94732 C18.30913,11.94732 18.34547,11.94828 18.38313,11.9502 C19.15819,11.98968 21.8158,12.5653 21.8158,14.73802 C21.8158,16.9865 17.89036,17.75 15.8954,17.75 C14.4783,17.75 11.06964,17.3675 10.0381211,15.05838 C9.880603,14.70591 10.247411,14.60818 10.478933,14.89817 C11.53861,16.22513 15.97381,17.0274 17.17097,15.55563 C17.1762,15.5496 17.18143,15.54339 17.18659,15.5373 C17.22564,15.49052 17.26142,15.44143 17.2936,15.38996 C17.42416,15.18117 17.49672,14.93309 17.49672,14.64182 L17.49672,12.97565 C17.49672,12.57613 17.55718,12.31325 17.68428,12.14919 Z" id="Shape" fill="#FFFFFF"></path>
22
- </g>
23
- <g id="amex" transform="translate(71.000000, 0.000000)">
24
- <path d="M3.62903,3.5 L27.371,3.5 C29.3701,3.5 31,5.13976 31,7.17391 L31,22.8261 C31,24.8602 29.3701,26.5 27.371,26.5 L3.62903,26.5 C1.62986,26.5 0,24.8602 0,22.8261 L0,7.17391 C0,5.13976 1.62986,3.5 3.62903,3.5 Z" id="Shape" fill="#0095FF" fill-rule="nonzero"></path>
25
  <g id="Clipped">
26
  <g id="Group-Clipped">
27
- <mask id="mask-3" fill="white">
28
- <use xlink:href="#path-2"></use>
29
  </mask>
30
  <g id="path-3"></g>
31
- <g id="Group" mask="url(#mask-3)">
32
- <g transform="translate(-1.937500, 9.000000)">
33
  <g>
34
- <g transform="translate(0.745938, 0.846000)" fill="#FFFFFF" fill-rule="nonzero" id="Shape">
35
- <path d="M3.02304965,2.98730396 L2.3254228,1.4339059 L1.7440671,2.98730396 L3.02304965,2.98730396 Z M16.7430442,2.27035101 C16.6628492,2.38734428 16.5148678,2.38984317 16.3942307,2.38984317 L15.2315194,2.38984317 L15.2315194,1.55339806 L16.3942307,1.55339806 C16.5113061,1.55339806 16.6768662,1.56044037 16.7430442,1.67289022 C16.9025149,1.6761842 16.9755864,1.7929503 16.9755864,1.91187453 C16.9755864,2.11882768 16.9060766,2.25126861 16.7430442,2.27035101 Z M24.882024,2.98730396 L24.1843972,1.4339059 L23.6030415,2.98730396 L24.882024,2.98730396 Z M9.99931805,4.77968633 L9.06914894,4.77968633 L9.06914894,1.67289022 L7.67389525,4.77968633 L6.85999728,4.77968633 L5.58101473,1.67289022 L5.58101473,4.77968633 L3.60440535,4.77968633 L3.25559193,3.94324122 L1.39525369,3.94324122 L1.04644026,4.77968633 L0,4.77968633 L1.62779596,0.836445108 L3.02304965,0.836445108 L4.65084561,4.54070202 L4.65084561,0.836445108 L6.16237043,0.836445108 L7.32508184,3.46527259 L8.48779324,0.836445108 L9.99931805,0.836445108 L9.99931805,4.77968633 Z M13.7199945,4.77968633 L10.6969449,4.77968633 L10.6969449,0.836445108 L13.7199945,0.836445108 L13.7199945,1.67289022 L11.627114,1.67289022 L11.627114,2.38984317 L13.7199945,2.38984317 L13.7199945,3.22628827 L11.627114,3.22628827 L11.627114,3.94324122 L13.7199945,3.94324122 L13.7199945,4.77968633 Z M18.1382979,1.91187453 C18.1382979,2.52713625 17.7259413,2.85195352 17.440671,2.98730396 C17.6883056,3.02798045 17.8614065,3.16666113 17.9057556,3.22628827 C18.0745977,3.4776817 18.0971557,3.65287607 18.1382979,4.06273338 L18.1382979,4.77968633 L17.2081288,4.77968633 L17.2081288,4.3017177 C17.1594186,4.04513069 17.1817428,3.7039001 16.9755864,3.46527259 C16.877852,3.37551471 16.6715567,3.34542362 16.3942307,3.34578043 L15.3477905,3.34578043 L15.3477905,4.77968633 L14.4176213,4.77968633 L14.4176213,0.836445108 L16.5105019,0.836445108 C17.021382,0.836445108 17.3701552,0.84917138 17.6732133,1.07542942 C17.9626256,1.20146312 18.1382979,1.45860517 18.1382979,1.91187453 Z M19.5335515,4.77968633 L18.6033824,4.77968633 L18.6033824,0.836445108 L19.5335515,0.836445108 L19.5335515,4.77968633 Z M30.4630387,4.77968633 L29.1840562,4.77968633 L27.4399891,1.79238237 L27.4399891,4.77968633 L25.5796509,4.77968633 L25.1145663,3.94324122 L23.254228,3.94324122 L22.9054147,4.77968633 L21.8589744,4.77968633 C21.3802594,4.77968633 20.8127383,4.67835191 20.4637207,4.3017177 C20.1672516,4.00873593 19.9986361,3.5552287 19.9986361,2.8678118 C19.9986361,2.253343 20.0994097,1.71872065 20.4637207,1.31441374 C20.793887,0.981548393 21.2607506,0.836445108 21.8589744,0.836445108 L22.7891434,0.836445108 L22.7891434,1.67289022 L21.8589744,1.67289022 C21.578432,1.6813744 21.388405,1.73251736 21.1613475,1.91187453 C21.0481485,2.08100312 20.9402764,2.39487817 20.9288052,2.8678118 C20.9402764,3.2306493 21.0224314,3.53524726 21.1613475,3.70425691 C21.3358073,3.89027456 21.5937924,3.93761153 21.8589744,3.94324122 L22.2077877,3.94324122 L23.6030415,0.836445108 L24.882024,0.836445108 L26.50982,4.54070202 L26.50982,0.836445108 L27.9050736,0.836445108 L29.5328696,3.58476475 L29.5328696,0.836445108 L30.4630387,0.836445108 L30.4630387,4.77968633 Z M0,5.49663928 L1.62779596,5.49663928 L1.97660939,4.66019417 L2.67423623,4.66019417 L3.02304965,5.49663928 L6.16237043,5.49663928 L6.16237043,4.77968633 L6.51118385,5.49663928 L8.02270868,5.49663928 L8.37152209,4.77968633 L8.37152209,5.49663928 L16.0454174,5.49663928 L16.0454174,4.06273338 L16.1616885,4.06273338 C16.2952536,4.06129216 16.3257367,4.07115342 16.2779596,4.3017177 L16.2779596,5.49663928 L20.3474496,5.49663928 L20.3474496,5.13816281 C20.6311992,5.33529491 21.1310308,5.49378784 21.7427032,5.49663928 L23.4867703,5.49663928 L23.8355837,4.66019417 L24.6494817,4.66019417 L24.9982952,5.49663928 L28.2538871,5.49663928 L28.2538871,4.66019417 L28.7189717,5.49663928 L31.2769368,5.49663928 L31.2769368,0 L28.7189717,0 L28.7189717,0.597460792 L28.3701582,0 L25.695922,0 L25.695922,0.597460792 L25.3471085,0 L21.8589744,0 C21.2542435,0 20.7318404,0.0847117372 20.3474496,0.358476475 L20.3474496,0 L17.9057556,0 L17.9057556,0.358476475 C17.5912554,0.0774643095 17.2253405,0 16.8593153,0 L7.90643754,0 L7.20881069,1.4339059 L6.62745499,0 L3.83694763,0 L3.83694763,0.597460792 L3.4881342,0 L1.1627114,0 L0,2.62882748 L0,5.49663928 Z M33.0585277,7.67289022 L31.3144606,7.67289022 C31.192706,7.67289022 31.0801811,7.67904465 30.9656472,7.79238237 C30.8871975,7.80236116 30.849376,7.89319597 30.849376,8.03136669 C30.849376,8.15567095 30.9323014,8.25266019 31.0819183,8.27035101 C31.1511259,8.32776702 31.2566032,8.33745454 31.4307317,8.38984317 L31.8958163,8.38984317 C32.4251937,8.36275608 32.7649999,8.4476644 32.9422566,8.62882748 C33.0099,8.68358417 33.0325694,8.71595191 33.0585277,8.74831964 L33.0585277,7.67289022 Z M33.0585277,10.1822255 C32.8345848,10.5511865 32.3982163,10.7206152 31.7795452,10.7796863 L30.035478,10.7796863 L30.035478,9.82374907 L31.7795452,9.82374907 C31.9761567,9.87632097 32.099238,9.85269355 32.1283585,9.82374907 C32.237559,9.71793417 32.2823476,9.62947978 32.2446298,9.46527259 C32.2823476,9.40733457 32.237559,9.3162681 32.1283585,9.22628827 C32.1028444,9.20157421 32.0054729,9.17426615 31.8958163,9.22628827 C30.9792912,9.14422727 29.8993632,9.20157421 29.9192069,7.91187453 C29.8993632,7.38451908 30.254647,6.78338538 31.1981895,6.83644511 L33.0585277,6.83644511 L33.0585277,6 L31.3144606,6 C30.8373637,6 30.4633502,6.12585458 30.1517492,6.35847647 L30.1517492,6 L27.7100553,6 C27.2712631,6 26.7975514,6.10210843 26.5473439,6.35847647 L26.5473439,6 L22.0127694,6 L22.0127694,6.35847647 C21.7082905,6.05746567 21.1031214,6 20.850058,6 L17.8270083,6 L17.8270083,6.35847647 C17.5675002,6.04108083 16.9365049,6 16.5480258,6 L13.1761627,6 L12.4785359,6.83644511 L11.7809091,6 L6.78125,6 L6.78125,11.4966393 L11.6646379,11.4966393 L12.4785359,10.6601942 L13.1761627,11.4966393 L16.1992124,11.4966393 L16.1992124,10.1822255 L16.4317546,10.1822255 C16.8805483,10.210548 17.3508865,10.1941631 17.7107372,10.0627334 L17.7107372,11.4966393 L20.2687023,11.4966393 L20.2687023,10.0627334 L20.3849734,10.0627334 C20.5171473,10.0618971 20.5321543,10.0683086 20.5012445,10.1822255 L20.5012445,11.4966393 L28.0588687,11.4966393 C28.5412808,11.493671 29.0410514,11.3687663 29.3378512,11.1381628 L29.3378512,11.4966393 L31.663274,11.4966393 C32.2037059,11.493671 32.6891674,11.4225513 33.0585277,11.257655 L33.0585277,10.1822255 Z M29.4541223,8.74831964 C29.5899045,8.88981773 29.6866647,9.12954434 29.6866647,9.58476475 C29.6866647,10.3837093 29.1651894,10.7796863 28.1751398,10.7796863 L26.4310727,10.7796863 L26.4310727,9.94324122 L28.1751398,9.94324122 C28.3987133,9.93410302 28.5234368,9.91043953 28.6402244,9.82374907 C28.6653595,9.77547439 28.7111071,9.68688494 28.7564955,9.58476475 C28.7111071,9.46440057 28.6616155,9.37319506 28.6402244,9.34578043 C28.5270638,9.25832605 28.4292507,9.23097629 28.2914109,9.22628827 C27.4006914,9.20089155 26.3148015,9.25832605 26.3148015,8.03136669 C26.3148015,7.43849662 26.6683798,6.83644511 27.5937841,6.83644511 L29.4541223,6.83644511 L29.4541223,7.67289022 L27.8263264,7.67289022 C27.6297802,7.67572609 27.5201498,7.68214734 27.4775129,7.79238237 C27.3253425,7.81081013 27.2876681,7.90558301 27.2449707,8.03136669 C27.2876681,8.17943737 27.3738981,8.28063149 27.4775129,8.27035101 C27.5883616,8.35899451 27.693429,8.36910203 27.8263264,8.38984317 L28.4076821,8.38984317 C28.8538487,8.39526267 29.1993539,8.48373321 29.4541223,8.74831964 Z M20.9663291,8.27035101 C20.8885673,8.38377871 20.7379534,8.38984317 20.6175157,8.38984317 L19.4548043,8.38984317 L19.4548043,7.55339806 L20.6175157,7.55339806 C20.7379534,7.55339806 20.9001707,7.5567672 20.9663291,7.67289022 C21.1283321,7.68097615 21.1988713,7.79631304 21.1988713,7.91187453 C21.1988713,8.11503366 21.1283321,8.24339789 20.9663291,8.27035101 Z M21.5476848,8.98730396 C21.795985,9.02459796 21.9641472,9.1633641 22.0127694,9.22628827 C22.1734754,9.47074238 22.1923674,9.65041301 22.2453116,9.94324122 L22.2453116,10.7796863 L21.3151426,10.7796863 L21.3151426,10.3017177 C21.2682915,10.049113 21.290682,9.69785747 21.0826002,9.46527259 C20.9838618,9.37323747 20.7780322,9.33946748 20.3849734,9.34578043 L19.4548043,9.34578043 L19.4548043,10.7796863 L18.5246351,10.7796863 L18.5246351,6.83644511 L20.6175156,6.83644511 C21.126135,6.83644511 21.4668908,6.8574919 21.7802271,7.07542942 C22.0618726,7.20220743 22.2453116,7.44834787 22.2453116,7.91187453 C22.2451951,8.52756074 21.8335358,8.8487324 21.5476848,8.98730396 Z M22.8266674,6.83644511 L25.849717,6.83644511 L25.849717,7.67289022 L23.7568364,7.67289022 L23.7568364,8.38984317 L25.849717,8.38984317 L25.849717,9.22628827 L23.7568364,9.22628827 L23.7568364,9.94324122 L25.849717,9.94324122 L25.849717,10.7796863 L22.8266674,10.7796863 L22.8266674,6.83644511 Z M16.5480258,8.50933532 L15.3853143,8.50933532 L15.3853143,7.55339806 L16.5480258,7.55339806 C16.9012051,7.55339806 17.1293815,7.68538419 17.1293815,8.03136669 C17.1293815,8.3382967 16.9117753,8.50933532 16.5480258,8.50933532 Z M14.4551453,10.3017177 L13.0598916,8.74831964 L14.4551453,7.19492158 L14.4551453,10.3017177 Z M10.8507399,9.82374907 L8.5253171,9.82374907 L8.5253171,9.10679612 L10.6181976,9.10679612 L10.6181976,8.27035101 L8.5253171,8.27035101 L8.5253171,7.55339806 L10.8507399,7.55339806 L11.8971802,8.62882748 L10.8507399,9.82374907 Z M18.0595506,8.15085885 C18.0595506,9.23090408 17.263779,9.45706791 16.4317546,9.46527259 L15.2690432,9.46527259 L15.2690432,10.7796863 L13.5249761,10.7796863 L12.3622648,9.46527259 L11.1995533,10.7796863 L7.59514799,10.7796863 L7.59514799,6.83644511 L11.3158245,6.83644511 L12.3622648,8.15085885 L13.5249761,6.83644511 L16.5480258,6.83644511 C17.241433,6.83644511 18.0595506,7.04346468 18.0595506,8.15085885 Z"></path>
36
  </g>
37
  </g>
38
  </g>
@@ -40,15 +27,15 @@
40
  </g>
41
  </g>
42
  </g>
43
- <g id="mastercard" transform="translate(36.000000, 3.000000)">
44
  <path d="M3.62903,0.5 L27.371,0.5 C29.3701,0.5 31,2.13976 31,4.17391 L31,19.8261 C31,21.8602 29.3701,23.5 27.371,23.5 L3.62903,23.5 C1.62986,23.5 0,21.8602 0,19.8261 L0,4.17391 C0,2.13976 1.62986,0.5 3.62903,0.5 Z" id="Shape" stroke="#E5E5E5" fill="#FFFFFF" fill-rule="nonzero"></path>
45
  <path d="M12.40323,17.21739 C15.25373,17.21739 17.56454,14.88147 17.56454,11.99998 C17.56454,9.1185 15.25373,6.78259 12.40323,6.78259 C9.55273,6.78259 7.24194,9.1185 7.24194,11.99998 C7.24194,14.88147 9.55273,17.21739 12.40323,17.21739 Z" id="Shape" fill="#E7001A" fill-rule="nonzero"></path>
46
  <path d="M18.59679,17.21739 C21.44729,17.21739 23.7581,14.88147 23.7581,11.99998 C23.7581,9.1185 21.44729,6.78259 18.59679,6.78259 C15.74629,6.78259 13.4355,9.1185 13.4355,11.99998 C13.4355,14.88147 15.74629,17.21739 18.59679,17.21739 Z" id="Shape" fill="#F49B1C" fill-rule="nonzero"></path>
47
  <path d="M15.50002,7.82568 C16.75364,8.777547 17.56453,10.29303 17.56453,11.99997 C17.56453,13.70692 16.75364,15.2224 15.50002,16.17427 C14.246394,15.2224 13.4355,13.70692 13.4355,11.99997 C13.4355,10.29303 14.246394,8.777547 15.50002,7.82568 Z" id="Shape" fill="#E7001A" opacity="0.3"></path>
48
  </g>
49
- <g id="visa" transform="translate(-0.000000, 2.000000)" fill-rule="nonzero">
50
- <path d="M28,0.5 L4,0.5 C1.79086,0.5 0,2.29086 0,4.5 L0,20.5 C0,22.7091 1.79086,24.5 4,24.5 L28,24.5 C30.2091,24.5 32,22.7091 32,20.5 L32,4.5 C32,2.29086 30.2091,0.5 28,0.5 Z" id="Shape" fill="#27337A"></path>
51
- <path d="M16.30917,13.58183 C16.2989,12.74605 17.0307,12.27962 17.5821,12.00233 C18.1485,11.71778 18.3388,11.53534 18.3366,11.28092 C18.3323,10.89148 17.8848,10.71964 17.4659,10.71294 C16.73509,10.70123 16.31025,10.91659 15.97243,11.0795 L15.70921,9.807979 C16.04811,9.646736 16.67563,9.50613725 17.3264,9.5 C18.8539,9.5 19.8533,10.278315 19.8587,11.48512 C19.8646,13.01664 17.8064,13.10145 17.8204,13.78603 C17.8253,13.99358 18.0172,14.21508 18.4377,14.27143 C18.6458,14.29989 19.2203,14.32165 19.8717,14.012 L20.1273,15.24224 C19.7771,15.37391 19.3268,15.5 18.7663,15.5 C17.3286,15.5 16.31728,14.71108 16.30917,13.58183 Z M22.5839,15.39399 C22.305,15.39399 22.0699,15.22606 21.965,14.96829 L19.783,9.5903854 L21.3094,9.5903854 L21.6132,10.456853 L23.4785,10.456853 L23.6547,9.5903854 L25,9.5903854 L23.826,15.39399 L22.5839,15.39399 Z M22.7974,13.8262 L23.2379,11.64692 L22.0315,11.64692 L22.7974,13.8262 Z M14.45847,15.39399 L13.2553,9.5903854 L14.70981,9.5903854 L15.91244,15.39399 L14.45847,15.39399 Z M12.30671,15.39399 L10.79275,11.44384 L10.18035,14.80258 C10.10846,15.17751 9.82469,15.39399 9.50958,15.39399 L7.0345926,15.39399 L7,15.2255 C7.508078,15.11168 8.08534,14.92812 8.43505,14.73173 C8.64909,14.61177 8.71017,14.50688 8.78043,14.22178 L9.94036,9.5903854 L11.47757,9.5903854 L13.83418,15.39399 L12.30671,15.39399 Z" id="Shape" fill="#FFFFFF" transform="translate(16.000000, 12.500000) scale(-1, 1) rotate(-180.000000) translate(-16.000000, -12.500000) "></path>
52
  </g>
53
  </g>
54
  </svg>
1
  <?xml version="1.0" encoding="UTF-8" standalone="no"?>
2
+ <svg width="101px" height="24px" viewBox="0 0 101 24" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
3
  <!-- Generator: Sketch 50.2 (55047) - http://www.bohemiancoding.com/sketch -->
4
  <title>Slice 1</title>
5
  <desc>Created with Sketch.</desc>
6
  <defs>
7
+ <rect id="path-1" x="0" y="0" width="31" height="34" rx="8"></rect>
 
 
 
 
 
8
  </defs>
9
  <g id="Page-1" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd">
10
+ <g id="amex" transform="translate(70.000000, -4.000000)">
11
+ <path d="M3.62903,4 L27.371,4 C29.3701,4 31,5.71105391 31,7.83364522 L31,24.1663652 C31,26.2889043 29.3701,28 27.371,28 L3.62903,28 C1.62986,28 0,26.2889043 0,24.1663652 L0,7.83364522 C0,5.71105391 1.62986,4 3.62903,4 Z" id="Shape" fill="#0095FF" fill-rule="nonzero"></path>
 
 
 
 
 
 
 
 
12
  <g id="Clipped">
13
  <g id="Group-Clipped">
14
+ <mask id="mask-2" fill="white">
15
+ <use xlink:href="#path-1"></use>
16
  </mask>
17
  <g id="path-3"></g>
18
+ <g id="Group" mask="url(#mask-2)">
19
+ <g transform="translate(-1.937500, 9.562500)">
20
  <g>
21
+ <g transform="translate(0.745938, 0.898875)" fill="#FFFFFF" fill-rule="nonzero" id="Shape">
22
+ <path d="M3.02304965,3.17401046 L2.3254228,1.52352502 L1.7440671,3.17401046 L3.02304965,3.17401046 Z M16.7430442,2.41224795 C16.6628492,2.5365533 16.5148678,2.53920837 16.3942307,2.53920837 L15.2315194,2.53920837 L15.2315194,1.65048544 L16.3942307,1.65048544 C16.5113061,1.65048544 16.6768662,1.65796789 16.7430442,1.77744586 C16.9025149,1.78094571 16.9755864,1.90500969 16.9755864,2.03136669 C16.9755864,2.25125441 16.9060766,2.3919729 16.7430442,2.41224795 Z M24.882024,3.17401046 L24.1843972,1.52352502 L23.6030415,3.17401046 L24.882024,3.17401046 Z M9.99931805,5.07841673 L9.06914894,5.07841673 L9.06914894,1.77744586 L7.67389525,5.07841673 L6.85999728,5.07841673 L5.58101473,1.77744586 L5.58101473,5.07841673 L3.60440535,5.07841673 L3.25559193,4.1896938 L1.39525369,4.1896938 L1.04644026,5.07841673 L0,5.07841673 L1.62779596,0.888722927 L3.02304965,0.888722927 L4.65084561,4.8244959 L4.65084561,0.888722927 L6.16237043,0.888722927 L7.32508184,3.68185213 L8.48779324,0.888722927 L9.99931805,0.888722927 L9.99931805,5.07841673 Z M13.7199945,5.07841673 L10.6969449,5.07841673 L10.6969449,0.888722927 L13.7199945,0.888722927 L13.7199945,1.77744586 L11.627114,1.77744586 L11.627114,2.53920837 L13.7199945,2.53920837 L13.7199945,3.42793129 L11.627114,3.42793129 L11.627114,4.1896938 L13.7199945,4.1896938 L13.7199945,5.07841673 Z M18.1382979,2.03136669 C18.1382979,2.68508227 17.7259413,3.03020062 17.440671,3.17401046 C17.6883056,3.21722923 17.8614065,3.36457745 17.9057556,3.42793129 C18.0745977,3.69503681 18.0971557,3.88118082 18.1382979,4.31665422 L18.1382979,5.07841673 L17.2081288,5.07841673 L17.2081288,4.57057506 C17.1594186,4.29795136 17.1817428,3.93539386 16.9755864,3.68185213 C16.877852,3.58648438 16.6715567,3.5545126 16.3942307,3.55489171 L15.3477905,3.55489171 L15.3477905,5.07841673 L14.4176213,5.07841673 L14.4176213,0.888722927 L16.5105019,0.888722927 C17.021382,0.888722927 17.3701552,0.902244591 17.6732133,1.14264376 C17.9626256,1.27655457 18.1382979,1.54976799 18.1382979,2.03136669 Z M19.5335515,5.07841673 L18.6033824,5.07841673 L18.6033824,0.888722927 L19.5335515,0.888722927 L19.5335515,5.07841673 Z M30.4630387,5.07841673 L29.1840562,5.07841673 L27.4399891,1.90440627 L27.4399891,5.07841673 L25.5796509,5.07841673 L25.1145663,4.1896938 L23.254228,4.1896938 L22.9054147,5.07841673 L21.8589744,5.07841673 C21.3802594,5.07841673 20.8127383,4.9707489 20.4637207,4.57057506 C20.1672516,4.25928193 19.9986361,3.77743049 19.9986361,3.04705004 C19.9986361,2.39417694 20.0994097,1.82614069 20.4637207,1.3965646 C20.793887,1.04289517 21.2607506,0.888722927 21.8589744,0.888722927 L22.7891434,0.888722927 L22.7891434,1.77744586 L21.8589744,1.77744586 C21.578432,1.7864603 21.388405,1.8407997 21.1613475,2.03136669 C21.0481485,2.21106582 20.9402764,2.54455806 20.9288052,3.04705004 C20.9402764,3.43256488 21.0224314,3.75620021 21.1613475,3.93577297 C21.3358073,4.13341672 21.5937924,4.18371225 21.8589744,4.1896938 L22.2077877,4.1896938 L23.6030415,0.888722927 L24.882024,0.888722927 L26.50982,4.8244959 L26.50982,0.888722927 L27.9050736,0.888722927 L29.5328696,3.80881255 L29.5328696,0.888722927 L30.4630387,0.888722927 L30.4630387,5.07841673 Z M0,5.84017923 L1.62779596,5.84017923 L1.97660939,4.95145631 L2.67423623,4.95145631 L3.02304965,5.84017923 L6.16237043,5.84017923 L6.16237043,5.07841673 L6.51118385,5.84017923 L8.02270868,5.84017923 L8.37152209,5.07841673 L8.37152209,5.84017923 L16.0454174,5.84017923 L16.0454174,4.31665422 L16.1616885,4.31665422 C16.2952536,4.31512292 16.3257367,4.32560051 16.2779596,4.57057506 L16.2779596,5.84017923 L20.3474496,5.84017923 L20.3474496,5.45929799 C20.6311992,5.66875084 21.1310308,5.83714958 21.7427032,5.84017923 L23.4867703,5.84017923 L23.8355837,4.95145631 L24.6494817,4.95145631 L24.9982952,5.84017923 L28.2538871,5.84017923 L28.2538871,4.95145631 L28.7189717,5.84017923 L31.2769368,5.84017923 L31.2769368,0 L28.7189717,0 L28.7189717,0.634802091 L28.3701582,0 L25.695922,0 L25.695922,0.634802091 L25.3471085,0 L21.8589744,0 C21.2542435,0 20.7318404,0.0900062208 20.3474496,0.380881255 L20.3474496,0 L17.9057556,0 L17.9057556,0.380881255 C17.5912554,0.0823058288 17.2253405,0 16.8593153,0 L7.90643754,0 L7.20881069,1.52352502 L6.62745499,0 L3.83694763,0 L3.83694763,0.634802091 L3.4881342,0 L1.1627114,0 L0,2.7931292 L0,5.84017923 Z M33.0585277,8.15244586 L31.3144606,8.15244586 C31.192706,8.15244586 31.0801811,8.15898494 30.9656472,8.27940627 C30.8871975,8.29000873 30.849376,8.38652072 30.849376,8.53332711 C30.849376,8.66540038 30.9323014,8.76845145 31.0819183,8.78724795 C31.1511259,8.84825246 31.2566032,8.85854545 31.4307317,8.91420837 L31.8958163,8.91420837 C32.4251937,8.88542833 32.7649999,8.97564342 32.9422566,9.1681292 C33.0099,9.22630818 33.0325694,9.2606989 33.0585277,9.29508962 L33.0585277,8.15244586 Z M33.0585277,10.8186146 C32.8345848,11.2106357 32.3982163,11.3906536 31.7795452,11.4534167 L30.035478,11.4534167 L30.035478,10.4377334 L31.7795452,10.4377334 C31.9761567,10.493591 32.099238,10.4684869 32.1283585,10.4377334 C32.237559,10.3253051 32.2823476,10.2313223 32.2446298,10.0568521 C32.2823476,9.99529298 32.237559,9.89853486 32.1283585,9.80293129 C32.1028444,9.7766726 32.0054729,9.74765778 31.8958163,9.80293129 C30.9792912,9.71574147 29.8993632,9.7766726 29.9192069,8.40636669 C29.8993632,7.84605152 30.254647,7.20734697 31.1981895,7.26372293 L33.0585277,7.26372293 L33.0585277,6.375 L31.3144606,6.375 C30.8373637,6.375 30.4633502,6.50872049 30.1517492,6.75588125 L30.1517492,6.375 L27.7100553,6.375 C27.2712631,6.375 26.7975514,6.48349021 26.5473439,6.75588125 L26.5473439,6.375 L22.0127694,6.375 L22.0127694,6.75588125 C21.7082905,6.43605727 21.1031214,6.375 20.850058,6.375 L17.8270083,6.375 L17.8270083,6.75588125 C17.5675002,6.41864838 16.9365049,6.375 16.5480258,6.375 L13.1761627,6.375 L12.4785359,7.26372293 L11.7809091,6.375 L6.78125,6.375 L6.78125,12.2151793 L11.6646379,12.2151793 L12.4785359,11.3264563 L13.1761627,12.2151793 L16.1992124,12.2151793 L16.1992124,10.8186146 L16.4317546,10.8186146 C16.8805483,10.8487072 17.3508865,10.8312983 17.7107372,10.6916542 L17.7107372,12.2151793 L20.2687023,12.2151793 L20.2687023,10.6916542 L20.3849734,10.6916542 C20.5171473,10.6907657 20.5321543,10.6975779 20.5012445,10.8186146 L20.5012445,12.2151793 L28.0588687,12.2151793 C28.5412808,12.2120254 29.0410514,12.0793142 29.3378512,11.834298 L29.3378512,12.2151793 L31.663274,12.2151793 C32.2037059,12.2120254 32.6891674,12.1364608 33.0585277,11.9612584 L33.0585277,10.8186146 Z M29.4541223,9.29508962 C29.5899045,9.44543134 29.6866647,9.70014086 29.6866647,10.1838125 C29.6866647,11.0326911 29.1651894,11.4534167 28.1751398,11.4534167 L26.4310727,11.4534167 L26.4310727,10.5646938 L28.1751398,10.5646938 C28.3987133,10.5549845 28.5234368,10.529842 28.6402244,10.4377334 C28.6653595,10.3864415 28.7111071,10.2923152 28.7564955,10.1838125 C28.7111071,10.0559256 28.6616155,9.95901975 28.6402244,9.92989171 C28.5270638,9.83697143 28.4292507,9.80791231 28.2914109,9.80293129 C27.4006914,9.77594727 26.3148015,9.83697143 26.3148015,8.53332711 C26.3148015,7.90340266 26.6683798,7.26372293 27.5937841,7.26372293 L29.4541223,7.26372293 L29.4541223,8.15244586 L27.8263264,8.15244586 C27.6297802,8.15545897 27.5201498,8.16228155 27.4775129,8.27940627 C27.3253425,8.29898576 27.2876681,8.39968195 27.2449707,8.53332711 C27.2876681,8.69065221 27.3738981,8.79817096 27.4775129,8.78724795 C27.5883616,8.88143167 27.693429,8.89217091 27.8263264,8.91420837 L28.4076821,8.91420837 C28.8538487,8.91996659 29.1993539,9.01396654 29.4541223,9.29508962 Z M20.9663291,8.78724795 C20.8885673,8.90776488 20.7379534,8.91420837 20.6175157,8.91420837 L19.4548043,8.91420837 L19.4548043,8.02548544 L20.6175157,8.02548544 C20.7379534,8.02548544 20.9001707,8.02906515 20.9663291,8.15244586 C21.1283321,8.16103716 21.1988713,8.2835826 21.1988713,8.40636669 C21.1988713,8.62222326 21.1283321,8.75861026 20.9663291,8.78724795 Z M21.5476848,9.54901046 C21.795985,9.58863533 21.9641472,9.73607436 22.0127694,9.80293129 C22.1734754,10.0626638 22.1923674,10.2535638 22.2453116,10.5646938 L22.2453116,11.4534167 L21.3151426,11.4534167 L21.3151426,10.9455751 C21.2682915,10.6771826 21.290682,10.3039736 21.0826002,10.0568521 C20.9838618,9.95906481 20.7780322,9.9231842 20.3849734,9.92989171 L19.4548043,9.92989171 L19.4548043,11.4534167 L18.5246351,11.4534167 L18.5246351,7.26372293 L20.6175156,7.26372293 C21.126135,7.26372293 21.4668908,7.28608514 21.7802271,7.51764376 C22.0618726,7.65234539 22.2453116,7.91386961 22.2453116,8.40636669 C22.2451951,9.06053329 21.8335358,9.40177817 21.5476848,9.54901046 Z M22.8266674,7.26372293 L25.849717,7.26372293 L25.849717,8.15244586 L23.7568364,8.15244586 L23.7568364,8.91420837 L25.849717,8.91420837 L25.849717,9.80293129 L23.7568364,9.80293129 L23.7568364,10.5646938 L25.849717,10.5646938 L25.849717,11.4534167 L22.8266674,11.4534167 L22.8266674,7.26372293 Z M16.5480258,9.04116878 L15.3853143,9.04116878 L15.3853143,8.02548544 L16.5480258,8.02548544 C16.9012051,8.02548544 17.1293815,8.1657207 17.1293815,8.53332711 C17.1293815,8.85944024 16.9117753,9.04116878 16.5480258,9.04116878 Z M14.4551453,10.9455751 L13.0598916,9.29508962 L14.4551453,7.64460418 L14.4551453,10.9455751 Z M10.8507399,10.4377334 L8.5253171,10.4377334 L8.5253171,9.67597088 L10.6181976,9.67597088 L10.6181976,8.78724795 L8.5253171,8.78724795 L8.5253171,8.02548544 L10.8507399,8.02548544 L11.8971802,9.1681292 L10.8507399,10.4377334 Z M18.0595506,8.66028753 C18.0595506,9.80783558 17.263779,10.0481347 16.4317546,10.0568521 L15.2690432,10.0568521 L15.2690432,11.4534167 L13.5249761,11.4534167 L12.3622648,10.0568521 L11.1995533,11.4534167 L7.59514799,11.4534167 L7.59514799,7.26372293 L11.3158245,7.26372293 L12.3622648,8.66028753 L13.5249761,7.26372293 L16.5480258,7.26372293 C17.241433,7.26372293 18.0595506,7.48368122 18.0595506,8.66028753 Z"></path>
23
  </g>
24
  </g>
25
  </g>
27
  </g>
28
  </g>
29
  </g>
30
+ <g id="mastercard" transform="translate(35.000000, 0.000000)">
31
  <path d="M3.62903,0.5 L27.371,0.5 C29.3701,0.5 31,2.13976 31,4.17391 L31,19.8261 C31,21.8602 29.3701,23.5 27.371,23.5 L3.62903,23.5 C1.62986,23.5 0,21.8602 0,19.8261 L0,4.17391 C0,2.13976 1.62986,0.5 3.62903,0.5 Z" id="Shape" stroke="#E5E5E5" fill="#FFFFFF" fill-rule="nonzero"></path>
32
  <path d="M12.40323,17.21739 C15.25373,17.21739 17.56454,14.88147 17.56454,11.99998 C17.56454,9.1185 15.25373,6.78259 12.40323,6.78259 C9.55273,6.78259 7.24194,9.1185 7.24194,11.99998 C7.24194,14.88147 9.55273,17.21739 12.40323,17.21739 Z" id="Shape" fill="#E7001A" fill-rule="nonzero"></path>
33
  <path d="M18.59679,17.21739 C21.44729,17.21739 23.7581,14.88147 23.7581,11.99998 C23.7581,9.1185 21.44729,6.78259 18.59679,6.78259 C15.74629,6.78259 13.4355,9.1185 13.4355,11.99998 C13.4355,14.88147 15.74629,17.21739 18.59679,17.21739 Z" id="Shape" fill="#F49B1C" fill-rule="nonzero"></path>
34
  <path d="M15.50002,7.82568 C16.75364,8.777547 17.56453,10.29303 17.56453,11.99997 C17.56453,13.70692 16.75364,15.2224 15.50002,16.17427 C14.246394,15.2224 13.4355,13.70692 13.4355,11.99997 C13.4355,10.29303 14.246394,8.777547 15.50002,7.82568 Z" id="Shape" fill="#E7001A" opacity="0.3"></path>
35
  </g>
36
+ <g id="visa" fill-rule="nonzero">
37
+ <path d="M27.125,0 L3.875,0 C1.73489562,0 0,1.79086 0,4 L0,20 C0,22.2091 1.73489562,24 3.875,24 L27.125,24 C29.2650656,24 31,22.2091 31,20 L31,4 C31,1.79086 29.2650656,0 27.125,0 Z" id="Shape" fill="#27337A"></path>
38
+ <path d="M15.7919939,13.08183 C15.7822944,12.24605 16.4734389,11.77962 16.9942056,11.50233 C17.5291389,11.21778 17.7088667,11.03534 17.7067889,10.78092 C17.7027278,10.39148 17.2800889,10.21964 16.8844611,10.21294 C16.1942517,10.20123 15.7930139,10.41659 15.4739617,10.5795 L15.225365,9.307979 C15.5454372,9.146736 16.138095,9.00613725 16.7527111,9 C18.19535,9 19.1392278,9.778315 19.1443278,10.98512 C19.1499,12.51664 17.2060444,12.60145 17.2192667,13.28603 C17.2238944,13.49358 17.4051333,13.71508 17.8022722,13.77143 C17.9988111,13.79989 18.5413944,13.82165 19.1566056,13.512 L19.3980056,14.74224 C19.0672611,14.87391 18.6419778,15 18.1126167,15 C16.7547889,15 15.7996533,14.21108 15.7919939,13.08183 Z M21.7181278,14.89399 C21.4547222,14.89399 21.2326833,14.72606 21.1336111,14.46829 L19.0728333,9.0903854 L20.5144333,9.0903854 L20.8013556,9.956853 L22.5630278,9.956853 L22.7294389,9.0903854 L24,9.0903854 L22.8912222,14.89399 L21.7181278,14.89399 Z M21.9197667,13.3262 L22.3357944,11.14692 L21.1964167,11.14692 L21.9197667,13.3262 Z M14.0441106,14.89399 L12.9077833,9.0903854 L14.2814872,9.0903854 L15.4173044,14.89399 L14.0441106,14.89399 Z M12.0118928,14.89399 L10.5820417,10.94384 L10.0036639,14.30258 C9.93576778,14.67751 9.66776278,14.89399 9.37015889,14.89399 L7.03267079,14.89399 L7,14.7255 C7.47985144,14.61168 8.02504333,14.42812 8.355325,14.23173 C8.55747389,14.11177 8.61516056,14.00688 8.68151722,13.72178 L9.77700667,9.0903854 L11.2288161,9.0903854 L13.4545033,14.89399 L12.0118928,14.89399 Z" id="Shape" fill="#FFFFFF" transform="translate(15.500000, 12.000000) scale(-1, 1) rotate(-180.000000) translate(-15.500000, -12.000000) "></path>
39
  </g>
40
  </g>
41
  </svg>
includes/mollie-api-php/README.md CHANGED
@@ -2,7 +2,7 @@
2
 
3
  # Mollie API client for PHP #
4
 
5
- Accepting [iDEAL](https://www.mollie.com/en/payments/ideal/), [Bancontact/Mister Cash](https://www.mollie.com/en/payments/bancontact/), [SOFORT Banking](https://www.mollie.com/en/payments/sofort/), [Creditcard](https://www.mollie.com/en/payments/credit-card/), [SEPA Bank transfer](https://www.mollie.com/en/payments/bank-transfer/), [SEPA Direct debit](https://www.mollie.com/en/payments/direct-debit/), [Bitcoin](https://www.mollie.com/en/payments/bitcoin/), [PayPal](https://www.mollie.com/en/payments/paypal/), [Belfius Direct Net](https://www.mollie.com/en/payments/belfius/), [KBC/CBC](https://www.mollie.com/en/payments/kbc-cbc/), [paysafecard](https://www.mollie.com/en/payments/paysafecard/), [ING Home'Pay](https://www.mollie.com/en/payments/ing-homepay/), [Giftcards](https://www.mollie.com/en/payments/gift-cards/), [Giropay](https://www.mollie.com/en/payments/giropay/) and [EPS](https://www.mollie.com/en/payments/eps/) online payments without fixed monthly costs or any punishing registration procedures. Just use the Mollie API to receive payments directly on your website or easily refund transactions to your customers.
6
 
7
  [![Build Status](https://travis-ci.org/mollie/mollie-api-php.png)](https://travis-ci.org/mollie/mollie-api-php)
8
  [![Latest Stable Version](https://poser.pugx.org/mollie/mollie-api-php/v/stable)](https://packagist.org/packages/mollie/mollie-api-php)
2
 
3
  # Mollie API client for PHP #
4
 
5
+ Accepting [iDEAL](https://www.mollie.com/en/payments/ideal/), [Bancontact](https://www.mollie.com/en/payments/bancontact/), [SOFORT Banking](https://www.mollie.com/en/payments/sofort/), [Creditcard](https://www.mollie.com/en/payments/credit-card/), [SEPA Bank transfer](https://www.mollie.com/en/payments/bank-transfer/), [SEPA Direct debit](https://www.mollie.com/en/payments/direct-debit/), [Bitcoin](https://www.mollie.com/en/payments/bitcoin/), [PayPal](https://www.mollie.com/en/payments/paypal/), [Belfius Direct Net](https://www.mollie.com/en/payments/belfius/), [KBC/CBC](https://www.mollie.com/en/payments/kbc-cbc/), [paysafecard](https://www.mollie.com/en/payments/paysafecard/), [ING Home'Pay](https://www.mollie.com/en/payments/ing-homepay/), [Giftcards](https://www.mollie.com/en/payments/gift-cards/), [Giropay](https://www.mollie.com/en/payments/giropay/) and [EPS](https://www.mollie.com/en/payments/eps/) online payments without fixed monthly costs or any punishing registration procedures. Just use the Mollie API to receive payments directly on your website or easily refund transactions to your customers.
6
 
7
  [![Build Status](https://travis-ci.org/mollie/mollie-api-php.png)](https://travis-ci.org/mollie/mollie-api-php)
8
  [![Latest Stable Version](https://poser.pugx.org/mollie/mollie-api-php/v/stable)](https://packagist.org/packages/mollie/mollie-api-php)
includes/mollie-api-php/composer.json CHANGED
@@ -1,70 +1,70 @@
1
  {
2
- "name": "mollie\/mollie-api-php",
3
- "description": "Mollie API client library for PHP. Mollie is a European Payment Service provider and offers international payment methods such as Mastercard, VISA, American Express and PayPal, and local payment methods such as iDEAL, Bancontact, SOFORT Banking, SEPA direct debit, Belfius Direct Net, KBC Payment Button and various gift cards such as Podiumcadeaukaart and fashioncheque.",
4
- "homepage": "https:\/\/www.mollie.com\/en\/developers",
5
- "license": "BSD-2-Clause",
6
- "authors": [
7
- {
8
- "name": "Mollie B.V.",
9
- "email": "info@mollie.com"
10
- }
11
- ],
12
- "keywords": [
13
- "mollie",
14
- "payment",
15
- "service",
16
- "ideal",
17
- "creditcard",
18
- "mistercash",
19
- "bancontact",
20
- "sofort",
21
- "sofortbanking",
22
- "sepa",
23
- "bitcoin",
24
- "paypal",
25
- "paysafecard",
26
- "podiumcadeaukaart",
27
- "banktransfer",
28
- "direct debit",
29
- "belfius",
30
- "belfius direct net",
31
- "refunds",
32
- "api",
33
- "payments",
34
- "gateway",
35
- "subscriptions",
36
- "recurring",
37
- "charges",
38
- "kbc",
39
- "cbc",
40
- "gift cards",
41
- "intersolve",
42
- "fashioncheque",
43
- "inghomepay"
44
- ],
45
- "require": {
46
- "php": ">=5.6",
47
- "ext-curl": "*",
48
- "ext-json": "*",
49
- "ext-openssl": "*",
50
- "guzzlehttp\/guzzle": "^6.3",
51
- "composer\/ca-bundle": "^1.1"
52
- },
53
- "require-dev": {
54
- "phpunit\/phpunit": "^5.7|^6.5|^7.1",
55
- "eloquent\/liberator": "^2.0"
56
- },
57
- "autoload": {
58
- "psr-4": {
59
- "Mollie\\Api\\": "src\/"
60
- }
61
- },
62
- "autoload-dev": {
63
- "psr-4": {
64
- "_PhpScoper5b6804f9734c8\\Tests\\": "tests"
65
- }
66
- },
67
- "suggest": {
68
- "mollie\/oauth2-mollie-php": "Use OAuth to authenticate with the Mollie API. This is needed for some endpoints. Visit https:\/\/docs.mollie.com\/ for more information."
69
  }
70
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
  {
2
+ "name": "mollie/mollie-api-php",
3
+ "description": "Mollie API client library for PHP. Mollie is a European Payment Service provider and offers international payment methods such as Mastercard, VISA, American Express and PayPal, and local payment methods such as iDEAL, Bancontact, SOFORT Banking, SEPA direct debit, Belfius Direct Net, KBC Payment Button and various gift cards such as Podiumcadeaukaart and fashioncheque.",
4
+ "homepage": "https://www.mollie.com/en/developers",
5
+ "license": "BSD-2-Clause",
6
+ "authors": [
7
+ {
8
+ "name": "Mollie B.V.",
9
+ "email": "info@mollie.com"
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
10
  }
11
+ ],
12
+ "keywords": [
13
+ "mollie",
14
+ "payment",
15
+ "service",
16
+ "ideal",
17
+ "creditcard",
18
+ "mistercash",
19
+ "bancontact",
20
+ "sofort",
21
+ "sofortbanking",
22
+ "sepa",
23
+ "bitcoin",
24
+ "paypal",
25
+ "paysafecard",
26
+ "podiumcadeaukaart",
27
+ "banktransfer",
28
+ "direct debit",
29
+ "belfius",
30
+ "belfius direct net",
31
+ "refunds",
32
+ "api",
33
+ "payments",
34
+ "gateway",
35
+ "subscriptions",
36
+ "recurring",
37
+ "charges",
38
+ "kbc",
39
+ "cbc",
40
+ "gift cards",
41
+ "intersolve",
42
+ "fashioncheque",
43
+ "inghomepay"
44
+ ],
45
+ "require": {
46
+ "php": ">=5.6",
47
+ "ext-curl": "*",
48
+ "ext-json": "*",
49
+ "ext-openssl": "*",
50
+ "guzzlehttp/guzzle": "^6.3",
51
+ "composer/ca-bundle": "^1.1"
52
+ },
53
+ "require-dev": {
54
+ "phpunit/phpunit": "^5.7|^6.5|^7.1",
55
+ "eloquent/liberator": "^2.0"
56
+ },
57
+ "autoload": {
58
+ "psr-4": {
59
+ "Mollie\\Api\\": "src/"
60
+ }
61
+ },
62
+ "autoload-dev": {
63
+ "psr-4": {
64
+ "Tests\\": "tests"
65
+ }
66
+ },
67
+ "suggest": {
68
+ "mollie/oauth2-mollie-php": "Use OAuth to authenticate with the Mollie API. This is needed for some endpoints. Visit https://docs.mollie.com/ for more information."
69
+ }
70
+ }
includes/mollie-api-php/examples/01-new-payment.php CHANGED
@@ -1,10 +1,8 @@
1
  <?php
2
-
3
- namespace _PhpScoper5b6804f9734c8;
4
-
5
  /*
6
  * How to prepare a new payment with the Mollie API.
7
  */
 
8
  try {
9
  /*
10
  * Initialize the Mollie API library with your API key.
@@ -12,17 +10,20 @@ try {
12
  * See: https://www.mollie.com/dashboard/developers/api-keys
13
  */
14
  require "./initialize.php";
 
15
  /*
16
  * Generate a unique order id for this example. It is important to include this unique attribute
17
  * in the redirectUrl (below) so a proper return page can be shown to the customer.
18
  */
19
- $orderId = \time();
 
20
  /*
21
  * Determine the url parts to these example files.
22
  */
23
- $protocol = isset($_SERVER['HTTPS']) && \strcasecmp('off', $_SERVER['HTTPS']) !== 0 ? "https" : "http";
24
  $hostname = $_SERVER['HTTP_HOST'];
25
- $path = \dirname(isset($_SERVER['REQUEST_URI']) ? $_SERVER['REQUEST_URI'] : $_SERVER['PHP_SELF']);
 
26
  /*
27
  * Payment parameters:
28
  * amount Amount in EUROs. This example creates a € 10,- payment.
@@ -31,25 +32,40 @@ try {
31
  * webhookUrl Webhook location, used to report when the payment changes state.
32
  * metadata Custom metadata that is stored with the payment.
33
  */
34
- $payment = $mollie->payments->create(["amount" => ["currency" => "EUR", "value" => "10.00"], "description" => "Order #{$orderId}", "redirectUrl" => "{$protocol}://{$hostname}{$path}/03-return-page.php?order_id={$orderId}", "webhookUrl" => "{$protocol}://{$hostname}{$path}/02-webhook-verification.php", "metadata" => ["order_id" => $orderId]]);
 
 
 
 
 
 
 
 
 
 
 
 
35
  /*
36
  * In this example we store the order with its payment status in a database.
37
  */
38
- \_PhpScoper5b6804f9734c8\database_write($orderId, $payment->status);
 
39
  /*
40
  * Send the customer off to complete the payment.
41
  * This request should always be a GET, thus we enforce 303 http response code
42
  */
43
- \header("Location: " . $payment->getCheckoutUrl(), \true, 303);
44
  } catch (\Mollie\Api\Exceptions\ApiException $e) {
45
- echo "API call failed: " . \htmlspecialchars($e->getMessage());
46
  }
 
47
  /*
48
  * NOTE: This example uses a text file as a database. Please use a real database like MySQL in production code.
49
  */
50
  function database_write($orderId, $status)
51
  {
52
- $orderId = \intval($orderId);
53
- $database = \dirname(__FILE__) . "/orders/order-{$orderId}.txt";
54
- \file_put_contents($database, $status);
 
55
  }
1
  <?php
 
 
 
2
  /*
3
  * How to prepare a new payment with the Mollie API.
4
  */
5
+
6
  try {
7
  /*
8
  * Initialize the Mollie API library with your API key.
10
  * See: https://www.mollie.com/dashboard/developers/api-keys
11
  */
12
  require "./initialize.php";
13
+
14
  /*
15
  * Generate a unique order id for this example. It is important to include this unique attribute
16
  * in the redirectUrl (below) so a proper return page can be shown to the customer.
17
  */
18
+ $orderId = time();
19
+
20
  /*
21
  * Determine the url parts to these example files.
22
  */
23
+ $protocol = isset($_SERVER['HTTPS']) && strcasecmp('off', $_SERVER['HTTPS']) !== 0 ? "https" : "http";
24
  $hostname = $_SERVER['HTTP_HOST'];
25
+ $path = dirname(isset($_SERVER['REQUEST_URI']) ? $_SERVER['REQUEST_URI'] : $_SERVER['PHP_SELF']);
26
+
27
  /*
28
  * Payment parameters:
29
  * amount Amount in EUROs. This example creates a € 10,- payment.
32
  * webhookUrl Webhook location, used to report when the payment changes state.
33
  * metadata Custom metadata that is stored with the payment.
34
  */
35
+ $payment = $mollie->payments->create([
36
+ "amount" => [
37
+ "currency" => "EUR",
38
+ "value" => "10.00" // You must send the correct number of decimals, thus we enforce the use of strings
39
+ ],
40
+ "description" => "Order #{$orderId}",
41
+ "redirectUrl" => "{$protocol}://{$hostname}{$path}/03-return-page.php?order_id={$orderId}",
42
+ "webhookUrl" => "{$protocol}://{$hostname}{$path}/02-webhook-verification.php",
43
+ "metadata" => [
44
+ "order_id" => $orderId,
45
+ ],
46
+ ]);
47
+
48
  /*
49
  * In this example we store the order with its payment status in a database.
50
  */
51
+ database_write($orderId, $payment->status);
52
+
53
  /*
54
  * Send the customer off to complete the payment.
55
  * This request should always be a GET, thus we enforce 303 http response code
56
  */
57
+ header("Location: " . $payment->getCheckoutUrl(), true, 303);
58
  } catch (\Mollie\Api\Exceptions\ApiException $e) {
59
+ echo "API call failed: " . htmlspecialchars($e->getMessage());
60
  }
61
+
62
  /*
63
  * NOTE: This example uses a text file as a database. Please use a real database like MySQL in production code.
64
  */
65
  function database_write($orderId, $status)
66
  {
67
+ $orderId = intval($orderId);
68
+ $database = dirname(__FILE__) . "/orders/order-{$orderId}.txt";
69
+
70
+ file_put_contents($database, $status);
71
  }
includes/mollie-api-php/examples/02-webhook-verification.php CHANGED
@@ -1,12 +1,10 @@
1
  <?php
2
-
3
- namespace _PhpScoper5b6804f9734c8;
4
-
5
  /*
6
  * Example 2 - How to verify Mollie API Payments in a webhook.
7
  *
8
  * See: https://docs.mollie.com/guides/webhooks
9
  */
 
10
  try {
11
  /*
12
  * Initialize the Mollie API library with your API key.
@@ -14,15 +12,18 @@ try {
14
  * See: https://www.mollie.com/dashboard/developers/api-keys
15
  */
16
  require "./initialize.php";
 
17
  /*
18
  * Retrieve the payment's current state.
19
  */
20
  $payment = $mollie->payments->get($_POST["id"]);
21
  $orderId = $payment->metadata->order_id;
 
22
  /*
23
  * Update the order in the database.
24
  */
25
- \_PhpScoper5b6804f9734c8\database_write($orderId, $payment->status);
 
26
  if ($payment->isPaid() && !$payment->hasRefunds() && !$payment->hasChargebacks()) {
27
  /*
28
  * The payment is paid and isn't refunded or charged back.
@@ -60,14 +61,16 @@ try {
60
  */
61
  }
62
  } catch (\Mollie\Api\Exceptions\ApiException $e) {
63
- echo "API call failed: " . \htmlspecialchars($e->getMessage());
64
  }
 
65
  /*
66
  * NOTE: This example uses a text file as a database. Please use a real database like MySQL in production code.
67
  */
68
  function database_write($orderId, $status)
69
  {
70
- $orderId = \intval($orderId);
71
- $database = \dirname(__FILE__) . "/orders/order-{$orderId}.txt";
72
- \file_put_contents($database, $status);
 
73
  }
1
  <?php
 
 
 
2
  /*
3
  * Example 2 - How to verify Mollie API Payments in a webhook.
4
  *
5
  * See: https://docs.mollie.com/guides/webhooks
6
  */
7
+
8
  try {
9
  /*
10
  * Initialize the Mollie API library with your API key.
12
  * See: https://www.mollie.com/dashboard/developers/api-keys
13
  */
14
  require "./initialize.php";
15
+
16
  /*
17
  * Retrieve the payment's current state.
18
  */
19
  $payment = $mollie->payments->get($_POST["id"]);
20
  $orderId = $payment->metadata->order_id;
21
+
22
  /*
23
  * Update the order in the database.
24
  */
25
+ database_write($orderId, $payment->status);
26
+
27
  if ($payment->isPaid() && !$payment->hasRefunds() && !$payment->hasChargebacks()) {
28
  /*
29
  * The payment is paid and isn't refunded or charged back.
61
  */
62
  }
63
  } catch (\Mollie\Api\Exceptions\ApiException $e) {
64
+ echo "API call failed: " . htmlspecialchars($e->getMessage());
65
  }
66
+
67
  /*
68
  * NOTE: This example uses a text file as a database. Please use a real database like MySQL in production code.
69
  */
70
  function database_write($orderId, $status)
71
  {
72
+ $orderId = intval($orderId);
73
+ $database = dirname(__FILE__) . "/orders/order-{$orderId}.txt";
74
+
75
+ file_put_contents($database, $status);
76
  }
includes/mollie-api-php/examples/03-return-page.php CHANGED
@@ -1,33 +1,35 @@
1
  <?php
2
-
3
- namespace _PhpScoper5b6804f9734c8;
4
-
5
  /*
6
  * Example 3 - How to show a return page to the customer.
7
  *
8
  * In this example we retrieve the order stored in the database.
9
  * Here, it's unnecessary to use the Mollie API Client.
10
  */
11
- $status = \_PhpScoper5b6804f9734c8\database_read($_GET["order_id"]);
 
12
  /*
13
  * Determine the url parts to these example files.
14
  */
15
- $protocol = isset($_SERVER['HTTPS']) && \strcasecmp('off', $_SERVER['HTTPS']) !== 0 ? "https" : "http";
16
  $hostname = $_SERVER['HTTP_HOST'];
17
- $path = \dirname(isset($_SERVER['REQUEST_URI']) ? $_SERVER['REQUEST_URI'] : $_SERVER['PHP_SELF']);
18
- echo "<p>Your payment status is '" . \htmlspecialchars($status) . "'.</p>";
 
19
  echo "<p>";
20
  echo '<a href="' . $protocol . '://' . $hostname . $path . '/01-new-payment.php">Create payment with example 1</a><br>';
21
  echo '<a href="' . $protocol . '://' . $hostname . $path . '/04-ideal-payment.php">Create iDEAL payment with example 4</a><br>';
22
  echo '<a href="' . $protocol . '://' . $hostname . $path . '/05-payments-history.php">List payments with example 5</a><br>';
23
  echo "</p>";
 
24
  /*
25
  * NOTE: This example uses a text file as a database. Please use a real database like MySQL in production code.
26
  */
27
  function database_read($orderId)
28
  {
29
- $orderId = \intval($orderId);
30
- $database = \dirname(__FILE__) . "/orders/order-{$orderId}.txt";
31
- $status = @\file_get_contents($database);
 
 
32
  return $status ? $status : "unknown order";
33
  }
1
  <?php
 
 
 
2
  /*
3
  * Example 3 - How to show a return page to the customer.
4
  *
5
  * In this example we retrieve the order stored in the database.
6
  * Here, it's unnecessary to use the Mollie API Client.
7
  */
8
+ $status = database_read($_GET["order_id"]);
9
+
10
  /*
11
  * Determine the url parts to these example files.
12
  */
13
+ $protocol = isset($_SERVER['HTTPS']) && strcasecmp('off', $_SERVER['HTTPS']) !== 0 ? "https" : "http";
14
  $hostname = $_SERVER['HTTP_HOST'];
15
+ $path = dirname(isset($_SERVER['REQUEST_URI']) ? $_SERVER['REQUEST_URI'] : $_SERVER['PHP_SELF']);
16
+
17
+ echo "<p>Your payment status is '" . htmlspecialchars($status) . "'.</p>";
18
  echo "<p>";
19
  echo '<a href="' . $protocol . '://' . $hostname . $path . '/01-new-payment.php">Create payment with example 1</a><br>';
20
  echo '<a href="' . $protocol . '://' . $hostname . $path . '/04-ideal-payment.php">Create iDEAL payment with example 4</a><br>';
21
  echo '<a href="' . $protocol . '://' . $hostname . $path . '/05-payments-history.php">List payments with example 5</a><br>';
22
  echo "</p>";
23
+
24
  /*
25
  * NOTE: This example uses a text file as a database. Please use a real database like MySQL in production code.
26
  */
27
  function database_read($orderId)
28
  {
29
+ $orderId = intval($orderId);
30
+ $database = dirname(__FILE__) . "/orders/order-{$orderId}.txt";
31
+
32
+ $status = @file_get_contents($database);
33
+
34
  return $status ? $status : "unknown order";
35
  }
includes/mollie-api-php/examples/04-ideal-payment.php CHANGED
@@ -1,10 +1,8 @@
1
  <?php
2
-
3
- namespace _PhpScoper5b6804f9734c8;
4
-
5
  /*
6
  * Example 4 - How to prepare an iDEAL payment with the Mollie API.
7
  */
 
8
  try {
9
  /*
10
  * Initialize the Mollie API library with your API key.
@@ -12,30 +10,37 @@ try {
12
  * See: https://www.mollie.com/dashboard/developers/api-keys
13
  */
14
  require "./initialize.php";
 
15
  /*
16
  * First, let the customer pick the bank in a simple HTML form. This step is actually optional.
17
  */
18
  if ($_SERVER["REQUEST_METHOD"] != "POST") {
19
  $method = $mollie->methods->get(\Mollie\Api\Types\PaymentMethod::IDEAL, ["include" => "issuers"]);
 
20
  echo '<form method="post">Select your bank: <select name="issuer">';
 
21
  foreach ($method->issuers() as $issuer) {
22
- echo '<option value=' . \htmlspecialchars($issuer->id) . '>' . \htmlspecialchars($issuer->name) . '</option>';
23
  }
 
24
  echo '<option value="">or select later</option>';
25
  echo '</select><button>OK</button></form>';
26
  exit;
27
  }
 
28
  /*
29
  * Generate a unique order id for this example. It is important to include this unique attribute
30
  * in the redirectUrl (below) so a proper return page can be shown to the customer.
31
  */
32
- $orderId = \time();
 
33
  /*
34
  * Determine the url parts to these example files.
35
  */
36
- $protocol = isset($_SERVER['HTTPS']) && \strcasecmp('off', $_SERVER['HTTPS']) !== 0 ? "https" : "http";
37
  $hostname = $_SERVER['HTTP_HOST'];
38
- $path = \dirname(isset($_SERVER['REQUEST_URI']) ? $_SERVER['REQUEST_URI'] : $_SERVER['PHP_SELF']);
 
39
  /*
40
  * Payment parameters:
41
  * amount Amount in EUROs. This example creates a € 27.50 payment.
@@ -46,25 +51,43 @@ try {
46
  * metadata Custom metadata that is stored with the payment.
47
  * issuer The customer's bank. If empty the customer can select it later.
48
  */
49
- $payment = $mollie->payments->create(["amount" => ["currency" => "EUR", "value" => "27.50"], "method" => \Mollie\Api\Types\PaymentMethod::IDEAL, "description" => "Order #{$orderId}", "redirectUrl" => "{$protocol}://{$hostname}{$path}/03-return-page.php?order_id={$orderId}", "webhookUrl" => "{$protocol}://{$hostname}{$path}/02-webhook-verification.php", "metadata" => ["order_id" => $orderId], "issuer" => !empty($_POST["issuer"]) ? $_POST["issuer"] : null]);
 
 
 
 
 
 
 
 
 
 
 
 
 
 
50
  /*
51
  * In this example we store the order with its payment status in a database.
52
  */
53
- \_PhpScoper5b6804f9734c8\database_write($order_id, $payment->status);
 
54
  /*
55
  * Send the customer off to complete the payment.
56
  * This request should always be a GET, thus we enforce 303 http response code
57
  */
58
- \header("Location: " . $payment->getCheckoutUrl(), \true, 303);
59
  } catch (\Mollie\Api\Exceptions\ApiException $e) {
60
- echo "API call failed: " . \htmlspecialchars($e->getMessage());
61
  }
 
62
  /*
63
  * NOTE: This example uses a text file as a database. Please use a real database like MySQL in production code.
64
  */
65
  function database_write($orderId, $status)
66
  {
67
- $orderId = \intval($orderId);
68
- $database = \dirname(__FILE__) . "/orders/order-{$orderId}.txt";
69
- \file_put_contents($database, $status);
 
70
  }
 
1
  <?php
 
 
 
2
  /*
3
  * Example 4 - How to prepare an iDEAL payment with the Mollie API.
4
  */
5
+
6
  try {
7
  /*
8
  * Initialize the Mollie API library with your API key.
10
  * See: https://www.mollie.com/dashboard/developers/api-keys
11
  */
12
  require "./initialize.php";
13
+
14
  /*
15
  * First, let the customer pick the bank in a simple HTML form. This step is actually optional.
16
  */
17
  if ($_SERVER["REQUEST_METHOD"] != "POST") {
18
  $method = $mollie->methods->get(\Mollie\Api\Types\PaymentMethod::IDEAL, ["include" => "issuers"]);
19
+
20
  echo '<form method="post">Select your bank: <select name="issuer">';
21
+
22
  foreach ($method->issuers() as $issuer) {
23
+ echo '<option value=' . htmlspecialchars($issuer->id) . '>' . htmlspecialchars($issuer->name) . '</option>';
24
  }
25
+
26
  echo '<option value="">or select later</option>';
27
  echo '</select><button>OK</button></form>';
28
  exit;
29
  }
30
+
31
  /*
32
  * Generate a unique order id for this example. It is important to include this unique attribute
33
  * in the redirectUrl (below) so a proper return page can be shown to the customer.
34
  */
35
+ $orderId = time();
36
+
37
  /*
38
  * Determine the url parts to these example files.
39
  */
40
+ $protocol = isset($_SERVER['HTTPS']) && strcasecmp('off', $_SERVER['HTTPS']) !== 0 ? "https" : "http";
41
  $hostname = $_SERVER['HTTP_HOST'];
42
+ $path = dirname(isset($_SERVER['REQUEST_URI']) ? $_SERVER['REQUEST_URI'] : $_SERVER['PHP_SELF']);
43
+
44
  /*
45
  * Payment parameters:
46
  * amount Amount in EUROs. This example creates a € 27.50 payment.
51
  * metadata Custom metadata that is stored with the payment.
52
  * issuer The customer's bank. If empty the customer can select it later.
53
  */
54
+ $payment = $mollie->payments->create([
55
+ "amount" => [
56
+ "currency" => "EUR",
57
+ "value" => "27.50" // You must send the correct number of decimals, thus we enforce the use of strings
58
+ ],
59
+ "method" => \Mollie\Api\Types\PaymentMethod::IDEAL,
60
+ "description" => "Order #{$orderId}",
61
+ "redirectUrl" => "{$protocol}://{$hostname}{$path}/03-return-page.php?order_id={$orderId}",
62
+ "webhookUrl" => "{$protocol}://{$hostname}{$path}/02-webhook-verification.php",
63
+ "metadata" => [
64
+ "order_id" => $orderId,
65
+ ],
66
+ "issuer" => !empty($_POST["issuer"]) ? $_POST["issuer"] : null
67
+ ]);
68
+
69
  /*
70
  * In this example we store the order with its payment status in a database.
71
  */
72
+ database_write($order_id, $payment->status);
73
+
74
  /*
75
  * Send the customer off to complete the payment.
76
  * This request should always be a GET, thus we enforce 303 http response code
77
  */
78
+ header("Location: " . $payment->getCheckoutUrl(), true, 303);
79
  } catch (\Mollie\Api\Exceptions\ApiException $e) {
80
+ echo "API call failed: " . htmlspecialchars($e->getMessage());
81
  }
82
+
83
  /*
84
  * NOTE: This example uses a text file as a database. Please use a real database like MySQL in production code.
85
  */
86
  function database_write($orderId, $status)
87
  {
88
+ $orderId = intval($orderId);
89
+ $database = dirname(__FILE__) . "/orders/order-{$orderId}.txt";
90
+
91
+ file_put_contents($database, $status);
92
  }
93
+
includes/mollie-api-php/examples/05-payments-history.php CHANGED
@@ -1,10 +1,8 @@
1
  <?php
2
-
3
- namespace _PhpScoper5b6804f9734c8;
4
-
5
  /*
6
  * Example 5 - How to retrieve your payments history.
7
  */
 
8
  try {
9
  /*
10
  * Initialize the Mollie API library with your API key.
@@ -12,60 +10,76 @@ try {
12
  * See: https://www.mollie.com/dashboard/developers/api-keys
13
  */
14
  require "./initialize.php";
 
15
  /*
16
  * Determine the url parts to these example files.
17
  */
18
- $protocol = isset($_SERVER['HTTPS']) && \strcasecmp('off', $_SERVER['HTTPS']) !== 0 ? "https" : "http";
19
  $hostname = $_SERVER['HTTP_HOST'];
20
- $path = \dirname(isset($_SERVER['REQUEST_URI']) ? $_SERVER['REQUEST_URI'] : $_SERVER['PHP_SELF']);
 
21
  /*
22
  * Get the all payments for this API key ordered by newest.
23
  */
24
  $payments = $mollie->payments->page();
 
25
  echo "<ul>";
26
  foreach ($payments as $payment) {
27
  echo "<li>";
28
- echo "<strong style='font-family: monospace'>" . \htmlspecialchars($payment->id) . "</strong><br />";
29
- echo \htmlspecialchars($payment->description) . "<br />";
30
- echo \htmlspecialchars($payment->amount->currency) . " " . \htmlspecialchars($payment->amount->value) . "<br />";
31
- echo "Status: " . \htmlspecialchars($payment->status) . "<br />";
 
 
32
  if ($payment->hasRefunds()) {
33
  echo "Payment has been (partially) refunded.<br />";
34
  }
 
35
  if ($payment->hasChargebacks()) {
36
  echo "Payment has been charged back.<br />";
37
  }
 
38
  if ($payment->canBeRefunded() && $payment->amountRemaining->currency === 'EUR' && $payment->amountRemaining->value >= '2.00') {
39
- echo " (<a href=\"{$protocol}://{$hostname}{$path}/07-refund-payment.php?payment_id=" . \htmlspecialchars($payment->id) . "\">refund</a>)";
40
  }
 
41
  echo "</li>";
42
  }
43
  echo "</ul>";
 
44
  /**
45
  * Get the next set of Payments if applicable
46
  */
47
  $nextPayments = $payments->next();
 
48
  if (!empty($nextPayments)) {
49
  echo "<ul>";
50
  foreach ($nextPayments as $payment) {
51
  echo "<li>";
52
- echo "<strong style='font-family: monospace'>" . \htmlspecialchars($payment->id) . "</strong><br />";
53
- echo \htmlspecialchars($payment->description) . "<br />";
54
- echo \htmlspecialchars($payment->amount->currency) . " " . \htmlspecialchars($payment->amount->value) . "<br />";
55
- echo "Status: " . \htmlspecialchars($payment->status) . "<br />";
 
 
56
  if ($payment->hasRefunds()) {
57
  echo "Payment has been (partially) refunded.<br />";
58
  }
 
59
  if ($payment->hasChargebacks()) {
60
  echo "Payment has been charged back.<br />";
61
  }
 
62
  if ($payment->canBeRefunded() && $payment->amountRemaining->currency === 'EUR' && $payment->amountRemaining->value >= '2.00') {
63
- echo " (<a href=\"{$protocol}://{$hostname}{$path}/07-refund-payment.php?payment_id=" . \htmlspecialchars($payment->id) . "\">refund</a>)";
64
  }
 
65
  echo "</li>";
66
  }
67
  echo "</ul>";
68
  }
 
69
  } catch (\Mollie\Api\Exceptions\ApiException $e) {
70
- echo "API call failed: " . \htmlspecialchars($e->getMessage());
71
  }
1
  <?php
 
 
 
2
  /*
3
  * Example 5 - How to retrieve your payments history.
4
  */
5
+
6
  try {
7
  /*
8
  * Initialize the Mollie API library with your API key.
10
  * See: https://www.mollie.com/dashboard/developers/api-keys
11
  */
12
  require "./initialize.php";
13
+
14
  /*
15
  * Determine the url parts to these example files.
16
  */
17
+ $protocol = isset($_SERVER['HTTPS']) && strcasecmp('off', $_SERVER['HTTPS']) !== 0 ? "https" : "http";
18
  $hostname = $_SERVER['HTTP_HOST'];
19
+ $path = dirname(isset($_SERVER['REQUEST_URI']) ? $_SERVER['REQUEST_URI'] : $_SERVER['PHP_SELF']);
20
+
21
  /*
22
  * Get the all payments for this API key ordered by newest.
23
  */
24
  $payments = $mollie->payments->page();
25
+
26
  echo "<ul>";
27
  foreach ($payments as $payment) {
28
  echo "<li>";
29
+ echo "<strong style='font-family: monospace'>" . htmlspecialchars($payment->id) . "</strong><br />";
30
+ echo htmlspecialchars($payment->description) . "<br />";
31
+ echo htmlspecialchars($payment->amount->currency) . " " . htmlspecialchars($payment->amount->value) . "<br />";
32
+
33
+ echo "Status: " . htmlspecialchars($payment->status) . "<br />";
34
+
35
  if ($payment->hasRefunds()) {
36
  echo "Payment has been (partially) refunded.<br />";
37
  }
38
+
39
  if ($payment->hasChargebacks()) {
40
  echo "Payment has been charged back.<br />";
41
  }
42
+
43
  if ($payment->canBeRefunded() && $payment->amountRemaining->currency === 'EUR' && $payment->amountRemaining->value >= '2.00') {
44
+ echo " (<a href=\"{$protocol}://{$hostname}{$path}/07-refund-payment.php?payment_id=" . htmlspecialchars($payment->id) . "\">refund</a>)";
45
  }
46
+
47
  echo "</li>";
48
  }
49
  echo "</ul>";
50
+
51
  /**
52
  * Get the next set of Payments if applicable
53
  */
54
  $nextPayments = $payments->next();
55
+
56
  if (!empty($nextPayments)) {
57
  echo "<ul>";
58
  foreach ($nextPayments as $payment) {
59
  echo "<li>";
60
+ echo "<strong style='font-family: monospace'>" . htmlspecialchars($payment->id) . "</strong><br />";
61
+ echo htmlspecialchars($payment->description) . "<br />";
62
+ echo htmlspecialchars($payment->amount->currency) . " " . htmlspecialchars($payment->amount->value) . "<br />";
63
+
64
+ echo "Status: " . htmlspecialchars($payment->status) . "<br />";
65
+
66
  if ($payment->hasRefunds()) {
67
  echo "Payment has been (partially) refunded.<br />";
68
  }
69
+
70
  if ($payment->hasChargebacks()) {
71
  echo "Payment has been charged back.<br />";
72
  }
73
+
74
  if ($payment->canBeRefunded() && $payment->amountRemaining->currency === 'EUR' && $payment->amountRemaining->value >= '2.00') {
75
+ echo " (<a href=\"{$protocol}://{$hostname}{$path}/07-refund-payment.php?payment_id=" . htmlspecialchars($payment->id) . "\">refund</a>)";
76
  }
77
+
78
  echo "</li>";
79
  }
80
  echo "</ul>";
81
  }
82
+
83
  } catch (\Mollie\Api\Exceptions\ApiException $e) {
84
+ echo "API call failed: " . htmlspecialchars($e->getMessage());
85
  }
includes/mollie-api-php/examples/06-list-activated-methods.php CHANGED
@@ -1,10 +1,8 @@
1
  <?php
2
-
3
- namespace _PhpScoper5b6804f9734c8;
4
-
5
  /*
6
  * Example 6 - How to get the currently activated payment methods.
7
  */
 
8
  try {
9
  /*
10
  * Initialize the Mollie API library with your API key.
@@ -18,10 +16,10 @@ try {
18
  $methods = $mollie->methods->all();
19
  foreach ($methods as $method) {
20
  echo '<div style="line-height:40px; vertical-align:top">';
21
- echo '<img src="' . \htmlspecialchars($method->image->size1x) . '" srcset="' . \htmlspecialchars($method->image->size2x) . ' 2x"> ';
22
- echo \htmlspecialchars($method->description) . ' (' . \htmlspecialchars($method->id) . ')';
23
  echo '</div>';
24
  }
25
  } catch (\Mollie\Api\Exceptions\ApiException $e) {
26
- echo "API call failed: " . \htmlspecialchars($e->getMessage());
27
  }
1
  <?php
 
 
 
2
  /*
3
  * Example 6 - How to get the currently activated payment methods.
4
  */
5
+
6
  try {
7
  /*
8
  * Initialize the Mollie API library with your API key.
16
  $methods = $mollie->methods->all();
17
  foreach ($methods as $method) {
18
  echo '<div style="line-height:40px; vertical-align:top">';
19
+ echo '<img src="' . htmlspecialchars($method->image->size1x) . '" srcset="' . htmlspecialchars($method->image->size2x) . ' 2x"> ';
20
+ echo htmlspecialchars($method->description) . ' (' . htmlspecialchars($method->id) . ')';
21
  echo '</div>';
22
  }
23
  } catch (\Mollie\Api\Exceptions\ApiException $e) {
24
+ echo "API call failed: " . htmlspecialchars($e->getMessage());
25
  }
includes/mollie-api-php/examples/07-refund-payment.php CHANGED
@@ -1,10 +1,8 @@
1
  <?php
2
-
3
- namespace _PhpScoper5b6804f9734c8;
4
-
5
  /*
6
  * Example 7 - How to refund a payment programmatically
7
  */
 
8
  try {
9
  /*
10
  * Initialize the Mollie API library with your API key.
@@ -12,50 +10,62 @@ try {
12
  * See: https://www.mollie.com/dashboard/developers/api-keys
13
  */
14
  require "./initialize.php";
 
15
  /*
16
  * Determine the url parts to these example files.
17
  */
18
- $protocol = isset($_SERVER['HTTPS']) && \strcasecmp('off', $_SERVER['HTTPS']) !== 0 ? "https" : "http";
19
  $hostname = $_SERVER['HTTP_HOST'];
20
- $path = \dirname(isset($_SERVER['REQUEST_URI']) ? $_SERVER['REQUEST_URI'] : $_SERVER['PHP_SELF']);
 
21
  if (isset($_GET['payment_id'])) {
22
  /*
23
  * Retrieve the payment you want to refund from the API.
24
  */
25
  $paymentId = $_GET['payment_id'];
26
  $payment = $mollie->payments->get($paymentId);
 
27
  if ($payment->canBeRefunded() && $payment->amountRemaining->currency === 'EUR' && $payment->amountRemaining->value >= '2.00') {
28
  /*
29
  * Refund € 2,00 of the payment.
30
  *
31
  * https://docs.mollie.com/reference/v2/refunds-api/create-refund
32
  */
33
- $refund = $payment->refund(["amount" => ["currency" => "EUR", "value" => "2.00"]]);
34
- echo "{$refund->amount->currency} {$refund->amount->value} of payment {$paymentId} refunded.", \PHP_EOL;
 
 
 
 
 
 
35
  } else {
36
- echo "Payment {$paymentId} can not be refunded.", \PHP_EOL;
37
  }
 
38
  /*
39
  * Retrieve all refunds on a payment.
40
  */
41
  echo "<ul>";
42
  foreach ($payment->refunds() as $refund) {
43
  echo "<li>";
44
- echo "<strong style='font-family: monospace'>" . \htmlspecialchars($refund->id) . "</strong><br />";
45
- echo \htmlspecialchars($refund->description) . "<br />";
46
- echo \htmlspecialchars($refund->amount->currency) . " " . \htmlspecialchars($refund->amount->value) . "<br />";
47
- echo "Status: " . \htmlspecialchars($refund->status);
48
  echo "</li>";
49
  }
50
  echo "</ul>";
51
  }
 
52
  echo "Refund payment: ";
53
  echo "<form method='get'><input name='payment_id' value='tr_xxx'/><input type='submit' /></form>";
 
54
  echo "<p>";
55
  echo '<a href="' . $protocol . '://' . $hostname . $path . '/01-new-payment.php">Create payment with example 1</a><br>';
56
  echo '<a href="' . $protocol . '://' . $hostname . $path . '/04-ideal-payment.php">Create iDEAL payment with example 4</a><br>';
57
  echo '<a href="' . $protocol . '://' . $hostname . $path . '/05-payments-history.php">List payments with example 5</a><br>';
58
  echo "</p>";
59
  } catch (\Mollie\Api\Exceptions\ApiException $e) {
60
- echo "API call failed: " . \htmlspecialchars($e->getMessage());
61
  }
1
  <?php
 
 
 
2
  /*
3
  * Example 7 - How to refund a payment programmatically
4
  */
5
+
6
  try {
7
  /*
8
  * Initialize the Mollie API library with your API key.
10
  * See: https://www.mollie.com/dashboard/developers/api-keys
11
  */
12
  require "./initialize.php";
13
+
14
  /*
15
  * Determine the url parts to these example files.
16
  */
17
+ $protocol = isset($_SERVER['HTTPS']) && strcasecmp('off', $_SERVER['HTTPS']) !== 0 ? "https" : "http";
18
  $hostname = $_SERVER['HTTP_HOST'];
19
+ $path = dirname(isset($_SERVER['REQUEST_URI']) ? $_SERVER['REQUEST_URI'] : $_SERVER['PHP_SELF']);
20
+
21
  if (isset($_GET['payment_id'])) {
22
  /*
23
  * Retrieve the payment you want to refund from the API.
24
  */
25
  $paymentId = $_GET['payment_id'];
26
  $payment = $mollie->payments->get($paymentId);
27
+
28
  if ($payment->canBeRefunded() && $payment->amountRemaining->currency === 'EUR' && $payment->amountRemaining->value >= '2.00') {
29
  /*
30
  * Refund € 2,00 of the payment.
31
  *
32
  * https://docs.mollie.com/reference/v2/refunds-api/create-refund
33
  */
34
+ $refund = $payment->refund([
35
+ "amount" => [
36
+ "currency" => "EUR",
37
+ "value" => "2.00" // You must send the correct number of decimals, thus we enforce the use of strings
38
+ ]
39
+ ]);
40
+
41
+ echo "{$refund->amount->currency} {$refund->amount->value} of payment {$paymentId} refunded.", PHP_EOL;
42
  } else {
43
+ echo "Payment {$paymentId} can not be refunded.", PHP_EOL;
44
  }
45
+
46
  /*
47
  * Retrieve all refunds on a payment.
48
  */
49
  echo "<ul>";
50
  foreach ($payment->refunds() as $refund) {
51
  echo "<li>";
52
+ echo "<strong style='font-family: monospace'>" . htmlspecialchars($refund->id) . "</strong><br />";
53
+ echo htmlspecialchars($refund->description) . "<br />";
54
+ echo htmlspecialchars($refund->amount->currency) . " " . htmlspecialchars($refund->amount->value) . "<br />";
55
+ echo "Status: " . htmlspecialchars($refund->status);
56
  echo "</li>";
57
  }
58
  echo "</ul>";
59
  }
60
+
61
  echo "Refund payment: ";
62
  echo "<form method='get'><input name='payment_id' value='tr_xxx'/><input type='submit' /></form>";
63
+
64
  echo "<p>";
65
  echo '<a href="' . $protocol . '://' . $hostname . $path . '/01-new-payment.php">Create payment with example 1</a><br>';
66
  echo '<a href="' . $protocol . '://' . $hostname . $path . '/04-ideal-payment.php">Create iDEAL payment with example 4</a><br>';
67
  echo '<a href="' . $protocol . '://' . $hostname . $path . '/05-payments-history.php">List payments with example 5</a><br>';
68
  echo "</p>";
69
  } catch (\Mollie\Api\Exceptions\ApiException $e) {
70
+ echo "API call failed: " . htmlspecialchars($e->getMessage());
71
  }
includes/mollie-api-php/examples/08-oauth-list-profiles.php CHANGED
@@ -1,11 +1,9 @@
1
  <?php
2
-
3
- namespace _PhpScoper5b6804f9734c8;
4
-
5
  /*
6
  * Example 8 - Using OAuth access token to list profiles of an account.
7
  */
8
- try {
 
9
  /*
10
  * Initialize the Mollie API library with your OAuth access token.
11
  */
@@ -14,11 +12,16 @@ try {
14
  * Get the all the profiles for this account.
15
  */
16
  $profiles = $mollie->profiles->page();
17
- foreach ($profiles as $profile) {
 
18
  echo '<div style="line-height:40px; vertical-align:top">';
19
- echo \htmlspecialchars($profile->name) . ' - ' . \htmlspecialchars($profile->website) . ' (' . \htmlspecialchars($profile->id) . ')';
 
 
20
  echo '</div>';
21
  }
22
- } catch (\Mollie\Api\Exceptions\ApiException $e) {
23
- echo "API call failed: " . \htmlspecialchars($e->getMessage());
24
  }
 
 
 
 
1
  <?php
 
 
 
2
  /*
3
  * Example 8 - Using OAuth access token to list profiles of an account.
4
  */
5
+ try
6
+ {
7
  /*
8
  * Initialize the Mollie API library with your OAuth access token.
9
  */
12
  * Get the all the profiles for this account.
13
  */
14
  $profiles = $mollie->profiles->page();
15
+ foreach ($profiles as $profile)
16
+ {
17
  echo '<div style="line-height:40px; vertical-align:top">';
18
+ echo htmlspecialchars($profile->name) .
19
+ ' - ' . htmlspecialchars($profile->website) .
20
+ ' (' . htmlspecialchars($profile->id) . ')';
21
  echo '</div>';
22
  }
 
 
23
  }
24
+ catch (\Mollie\Api\Exceptions\ApiException $e)
25
+ {
26
+ echo "API call failed: " . htmlspecialchars($e->getMessage());
27
+ }
includes/mollie-api-php/examples/09-oauth-list-settlements.php CHANGED
@@ -1,10 +1,8 @@
1
  <?php
2
-
3
- namespace _PhpScoper5b6804f9734c8;
4
-
5
  /*
6
  * Example 9 - Using OAuth access token to list settlements of an account.
7
  */
 
8
  try {
9
  /*
10
  * Initialize the Mollie API library with your OAuth access token.
@@ -16,39 +14,39 @@ try {
16
  $settlements = $mollie->settlements->page();
17
  echo '<ul>';
18
  foreach ($settlements as $settlement) {
19
- echo '<li><b>Settlement ' . \htmlspecialchars($settlement->reference) . ':</b> (' . \htmlspecialchars($settlement->createdAt) . ')';
20
  echo '<table border="1"><tr><th>Month</th><th>Description</th><th>Count</th><th>Net</th><th>VAT</th><th>Gross</th></tr>';
21
  // Convert from stdClass to array
22
- $settlement_periods = \json_decode(\json_encode($settlement->periods), \TRUE);
23
  foreach ($settlement_periods as $year => $months) {
24
  foreach ($months as $month => $monthly_settlement) {
25
  foreach ($monthly_settlement['revenue'] as $revenue) {
26
  echo '<tr>';
27
- echo '<td>' . \htmlspecialchars($year . '-' . $month) . '</td>';
28
- echo '<td>' . \htmlspecialchars($revenue['description']) . '</td>';
29
- echo '<td align="right">' . \htmlspecialchars($revenue['count']) . ' x</td>';
30
- echo '<td align="right">' . \htmlspecialchars($revenue['amountNet']['value'] ? $revenue['amountNet']['value'] . " " . $revenue['amountNet']['currency'] : '-') . '</td>';
31
- echo '<td align="right">' . \htmlspecialchars($revenue['amountVat']['value'] ? $revenue['amountVat']['value'] . " " . $revenue['amountVat']['currency'] : '-') . '</td>';
32
- echo '<td align="right">' . \htmlspecialchars($revenue['amountGross']['value'] ? $revenue['amountGross']['value'] . " " . $revenue['amountGross']['currency'] : '-') . '</td>';
33
  echo '</tr>';
34
  }
35
  foreach ($monthly_settlement['costs'] as $revenue) {
36
  echo '<tr>';
37
- echo '<td>' . \htmlspecialchars($year . '-' . $month) . '</td>';
38
- echo '<td>' . \htmlspecialchars($revenue['description']) . '</td>';
39
- echo '<td align="right">' . \htmlspecialchars($revenue['count']) . ' x</td>';
40
- echo '<td align="right">' . \htmlspecialchars($revenue['amountNet']['value'] ? $revenue['amountNet']['value'] . " " . $revenue['amountNet']['currency'] : '-') . '</td>';
41
- echo '<td align="right">' . \htmlspecialchars($revenue['amountVat']['value'] ? $revenue['amountVat']['value'] . " " . $revenue['amountVat']['currency'] : '-') . '</td>';
42
- echo '<td align="right">' . \htmlspecialchars($revenue['amountGross']['value'] ? $revenue['amountGross']['value'] . " " . $revenue['amountGross']['currency'] : '-') . '</td>';
43
  echo '</tr>';
44
  }
45
  }
46
  }
47
- echo '<tr><th colspan="5" align="right">TOTAL</th><th align="right">' . \htmlspecialchars($settlement->amount->value . " " . $settlement->amount->currency) . '</th></tr>';
48
  echo '</table>';
49
  echo '</li>';
50
  }
51
  echo '</ul>';
52
  } catch (\Mollie\Api\Exceptions\ApiException $e) {
53
- echo "API call failed: " . \htmlspecialchars($e->getMessage());
54
- }
1
  <?php
 
 
 
2
  /*
3
  * Example 9 - Using OAuth access token to list settlements of an account.
4
  */
5
+
6
  try {
7
  /*
8
  * Initialize the Mollie API library with your OAuth access token.
14
  $settlements = $mollie->settlements->page();
15
  echo '<ul>';
16
  foreach ($settlements as $settlement) {
17
+ echo '<li><b>Settlement ' . htmlspecialchars($settlement->reference) . ':</b> (' . htmlspecialchars($settlement->createdAt) . ')';
18
  echo '<table border="1"><tr><th>Month</th><th>Description</th><th>Count</th><th>Net</th><th>VAT</th><th>Gross</th></tr>';
19
  // Convert from stdClass to array
20
+ $settlement_periods = json_decode(json_encode($settlement->periods), TRUE);
21
  foreach ($settlement_periods as $year => $months) {
22
  foreach ($months as $month => $monthly_settlement) {
23
  foreach ($monthly_settlement['revenue'] as $revenue) {
24
  echo '<tr>';
25
+ echo '<td>' . htmlspecialchars($year . '-' . $month) . '</td>';
26
+ echo '<td>' . htmlspecialchars($revenue['description']) . '</td>';
27
+ echo '<td align="right">' . htmlspecialchars($revenue['count']) . ' x</td>';
28
+ echo '<td align="right">' . htmlspecialchars($revenue['amountNet']['value'] ? $revenue['amountNet']['value'] . " " . $revenue['amountNet']['currency'] : '-') . '</td>';
29
+ echo '<td align="right">' . htmlspecialchars($revenue['amountVat']['value'] ? $revenue['amountVat']['value'] . " " . $revenue['amountVat']['currency'] : '-') . '</td>';
30
+ echo '<td align="right">' . htmlspecialchars($revenue['amountGross']['value'] ? $revenue['amountGross']['value'] . " " . $revenue['amountGross']['currency'] : '-') . '</td>';
31
  echo '</tr>';
32
  }
33
  foreach ($monthly_settlement['costs'] as $revenue) {
34
  echo '<tr>';
35
+ echo '<td>' . htmlspecialchars($year . '-' . $month) . '</td>';
36
+ echo '<td>' . htmlspecialchars($revenue['description']) . '</td>';
37
+ echo '<td align="right">' . htmlspecialchars($revenue['count']) . ' x</td>';
38
+ echo '<td align="right">' . htmlspecialchars($revenue['amountNet']['value'] ? $revenue['amountNet']['value'] . " " . $revenue['amountNet']['currency'] : '-') . '</td>';
39
+ echo '<td align="right">' . htmlspecialchars($revenue['amountVat']['value'] ? $revenue['amountVat']['value'] . " " . $revenue['amountVat']['currency'] : '-') . '</td>';
40
+ echo '<td align="right">' . htmlspecialchars($revenue['amountGross']['value'] ? $revenue['amountGross']['value'] . " " . $revenue['amountGross']['currency'] : '-') . '</td>';
41
  echo '</tr>';
42
  }
43
  }
44
  }
45
+ echo '<tr><th colspan="5" align="right">TOTAL</th><th align="right">' . htmlspecialchars($settlement->amount->value . " " . $settlement->amount->currency) . '</th></tr>';
46
  echo '</table>';
47
  echo '</li>';
48
  }
49
  echo '</ul>';
50
  } catch (\Mollie\Api\Exceptions\ApiException $e) {
51
+ echo "API call failed: " . htmlspecialchars($e->getMessage());
52
+ }
includes/mollie-api-php/examples/10-oauth-new-payment.php CHANGED
@@ -1,11 +1,9 @@
1
  <?php
2
-
3
- namespace _PhpScoper5b6804f9734c8;
4
-
5
  /*
6
  * Example 10 - Using OAuth access token to prepare a new payment.
7
  */
8
- try {
 
9
  /*
10
  * Initialize the Mollie API library with your OAuth access token.
11
  */
@@ -14,19 +12,19 @@ try {
14
  * Generate a unique order id for this example. It is important to include this unique attribute
15
  * in the redirectUrl (below) so a proper return page can be shown to the customer.
16
  */
17
- $orderId = \time();
18
  /*
19
  * Determine the url parts to these example files.
20
  */
21
- $protocol = isset($_SERVER['HTTPS']) && \strcasecmp('off', $_SERVER['HTTPS']) !== 0 ? "https" : "http";
22
- $hostname = $_SERVER['HTTP_HOST'] ?: "my.app";
23
- $path = \dirname(isset($_SERVER['REQUEST_URI']) ? $_SERVER['REQUEST_URI'] : $_SERVER['PHP_SELF']);
24
  /*
25
  * Since unlike an API key the OAuth access token does NOT belong to a profile, we need to retrieve a profile
26
  * so we can specify the profileId-parameter when creating a payment below.
27
  */
28
  $profiles = $mollie->profiles->page();
29
- $profile = \reset($profiles);
30
  /*
31
  * Payment parameters:
32
  * amount Amount in EUROs. This example creates a € 10,- payment.
@@ -35,29 +33,44 @@ try {
35
  * webhookUrl Webhook location, used to report when the payment changes state.
36
  * metadata Custom metadata that is stored with the payment.
37
  */
38
- $payment = $mollie->payments->create(array("amount" => ["value" => "10.00", "currency" => "EUR"], "description" => "My first API payment", "redirectUrl" => "{$protocol}://{$hostname}{$path}/03-return-page.php?order_id={$orderId}", "webhookUrl" => "{$protocol}://{$hostname}{$path}/02-webhook-verification.php", "metadata" => array("order_id" => $orderId), "profileId" => $profile->id));
 
 
 
 
 
 
 
 
 
 
 
 
39
  /*
40
  * In this example we store the order with its payment status in a database.
41
  */
42
- \_PhpScoper5b6804f9734c8\database_write($orderId, $payment->status);
43
  /*
44
  * Send the customer off to complete the payment.
45
  * This request should always be a GET, thus we enforce 303 http response code
46
  */
47
- if (\PHP_SAPI === "cli") {
48
- echo "Redirect to: " . $payment->getCheckoutUrl() . \PHP_EOL;
 
49
  return;
50
  }
51
- \header("Location: " . $payment->getCheckoutUrl(), \true, 303);
52
- } catch (\Mollie\Api\Exceptions\ApiException $e) {
53
- echo "API call failed: " . \htmlspecialchars($e->getMessage());
 
 
54
  }
55
  /*
56
  * NOTE: This example uses a text file as a database. Please use a real database like MySQL in production code.
57
  */
58
- function database_write($orderId, $status)
59
  {
60
- $orderId = \intval($orderId);
61
- $database = \dirname(__FILE__) . "/orders/order-{$orderId}.txt";
62
- \file_put_contents($database, $status);
63
- }
1
  <?php
 
 
 
2
  /*
3
  * Example 10 - Using OAuth access token to prepare a new payment.
4
  */
5
+ try
6
+ {
7
  /*
8
  * Initialize the Mollie API library with your OAuth access token.
9
  */
12
  * Generate a unique order id for this example. It is important to include this unique attribute
13
  * in the redirectUrl (below) so a proper return page can be shown to the customer.
14
  */
15
+ $orderId = time();
16
  /*
17
  * Determine the url parts to these example files.
18
  */
19
+ $protocol = isset($_SERVER['HTTPS']) && strcasecmp('off', $_SERVER['HTTPS']) !== 0 ? "https" : "http";
20
+ $hostname = $_SERVER['HTTP_HOST'] ? : "my.app";
21
+ $path = dirname(isset($_SERVER['REQUEST_URI']) ? $_SERVER['REQUEST_URI'] : $_SERVER['PHP_SELF']);
22
  /*
23
  * Since unlike an API key the OAuth access token does NOT belong to a profile, we need to retrieve a profile
24
  * so we can specify the profileId-parameter when creating a payment below.
25
  */
26
  $profiles = $mollie->profiles->page();
27
+ $profile = reset($profiles);
28
  /*
29
  * Payment parameters:
30
  * amount Amount in EUROs. This example creates a € 10,- payment.
33
  * webhookUrl Webhook location, used to report when the payment changes state.
34
  * metadata Custom metadata that is stored with the payment.
35
  */
36
+ $payment = $mollie->payments->create(array(
37
+ "amount" => [
38
+ "value" => "10.00",
39
+ "currency" => "EUR"
40
+ ],
41
+ "description" => "My first API payment",
42
+ "redirectUrl" => "{$protocol}://{$hostname}{$path}/03-return-page.php?order_id={$orderId}",
43
+ "webhookUrl" => "{$protocol}://{$hostname}{$path}/02-webhook-verification.php",
44
+ "metadata" => array(
45
+ "order_id" => $orderId,
46
+ ),
47
+ "profileId" => $profile->id // This is specifically necessary for payment resources via OAuth access.
48
+ ));
49
  /*
50
  * In this example we store the order with its payment status in a database.
51
  */
52
+ database_write($orderId, $payment->status);
53
  /*
54
  * Send the customer off to complete the payment.
55
  * This request should always be a GET, thus we enforce 303 http response code
56
  */
57
+ if (PHP_SAPI === "cli")
58
+ {
59
+ echo "Redirect to: " . $payment->getCheckoutUrl() . PHP_EOL;
60
  return;
61
  }
62
+ header("Location: " . $payment->getCheckoutUrl(), true, 303);
63
+ }
64
+ catch (\Mollie\Api\Exceptions\ApiException $e)
65
+ {
66
+ echo "API call failed: " . htmlspecialchars($e->getMessage());
67
  }
68
  /*
69
  * NOTE: This example uses a text file as a database. Please use a real database like MySQL in production code.
70
  */
71
+ function database_write ($orderId, $status)
72
  {
73
+ $orderId = intval($orderId);
74
+ $database = dirname(__FILE__) . "/orders/order-{$orderId}.txt";
75
+ file_put_contents($database, $status);
76
+ }
includes/mollie-api-php/examples/11-new-customer.php CHANGED
@@ -1,10 +1,8 @@
1
  <?php
2
-
3
- namespace _PhpScoper5b6804f9734c8;
4
-
5
  /*
6
  * Example 11 - How to create a new customer in the Mollie API.
7
  */
 
8
  try {
9
  /*
10
  * Initialize the Mollie API library with your API key or OAuth access token.
@@ -15,8 +13,14 @@ try {
15
  *
16
  * See: https://docs.mollie.com/reference/v2/customers-api/create-customer
17
  */
18
- $customer = $mollie->customers->create(["name" => "Luke Skywalker", "email" => "luke@example.org", "metadata" => array("isJedi" => \TRUE)]);
19
- echo "<p>New customer created " . \htmlspecialchars($customer->id) . " (" . \htmlspecialchars($customer->name) . ").</p>";
 
 
 
 
 
 
20
  } catch (\Mollie\Api\Exceptions\ApiException $e) {
21
- echo "API call failed: " . \htmlspecialchars($e->getMessage());
22
- }
1
  <?php
 
 
 
2
  /*
3
  * Example 11 - How to create a new customer in the Mollie API.
4
  */
5
+
6
  try {
7
  /*
8
  * Initialize the Mollie API library with your API key or OAuth access token.
13
  *
14
  * See: https://docs.mollie.com/reference/v2/customers-api/create-customer
15
  */
16
+ $customer = $mollie->customers->create([
17
+ "name" => "Luke Skywalker",
18
+ "email" => "luke@example.org",
19
+ "metadata" => array(
20
+ "isJedi" => TRUE,
21
+ ),
22
+ ]);
23
+ echo "<p>New customer created " . htmlspecialchars($customer->id) . " (" . htmlspecialchars($customer->name) . ").</p>";
24
  } catch (\Mollie\Api\Exceptions\ApiException $e) {
25
+ echo "API call failed: " . htmlspecialchars($e->getMessage());
26
+ }
includes/mollie-api-php/examples/12-new-customer-payment.php CHANGED
@@ -1,60 +1,72 @@
1
  <?php
2
-
3
- namespace _PhpScoper5b6804f9734c8;
4
-
5
  /*
6
  * Example 12 - How to create a new customer in the Mollie API.
7
  */
 
8
  try {
9
  /*
10
  * Initialize the Mollie API library with your API key or OAuth access token.
11
  */
12
  require "initialize.php";
 
13
  /*
14
  * Retrieve the last created customer for this example.
15
  * If no customers are created yet, run example 11.
16
  */
17
  $customer = $mollie->customers->page(null, 1)[0];
 
18
  /*
19
  * Generate a unique order id for this example. It is important to include this unique attribute
20
  * in the redirectUrl (below) so a proper return page can be shown to the customer.
21
  */
22
- $orderId = \time();
 
23
  /*
24
  * Determine the url parts to these example files.
25
  */
26
- $protocol = isset($_SERVER['HTTPS']) && \strcasecmp('off', $_SERVER['HTTPS']) !== 0 ? "https" : "http";
27
  $hostname = $_SERVER['HTTP_HOST'];
28
- $path = \dirname(isset($_SERVER['REQUEST_URI']) ? $_SERVER['REQUEST_URI'] : $_SERVER['PHP_SELF']);
 
29
  /*
30
  * Customer Payment creation parameters.
31
  *
32
  * Linking customers to payments has a few benefits, see:
33
  * https://docs.mollie.com/reference/v2/customers-api/create-customer-payment
34
  */
35
- $payment = $customer->createPayment(["amount" => [
36
- "value" => "10.00",
37
- // You must send the correct number of decimals, thus we enforce the use of strings
38
- "currency" => "EUR",
39
- ], "description" => "Order #{$orderId}", "redirectUrl" => "{$protocol}://{$hostname}{$path}/03-return-page.php?order_id={$orderId}", "webhookUrl" => "{$protocol}://{$hostname}{$path}/02-webhook-verification.php", "metadata" => ["order_id" => $orderId]]);
 
 
 
 
 
 
 
 
40
  /*
41
  * In this example we store the order with its payment status in a database.
42
  */
43
- \_PhpScoper5b6804f9734c8\database_write($orderId, $payment->status);
 
44
  /*
45
  * Send the customer off to complete the payment.
46
  * This request should always be a GET, thus we enforce 303 http response code
47
  */
48
- \header("Location: " . $payment->getCheckoutUrl(), \true, 303);
49
  } catch (\Mollie\Api\Exceptions\ApiException $e) {
50
- echo "API call failed: " . \htmlspecialchars($e->getMessage());
51
  }
 
52
  /*
53
  * NOTE: This example uses a text file as a database. Please use a real database like MySQL in production code.
54
  */
55
  function database_write($orderId, $status)
56
  {
57
- $orderId = \intval($orderId);
58
- $database = \dirname(__FILE__) . "/orders/order-{$orderId}.txt";
59
- \file_put_contents($database, $status);
60
  }
1
  <?php
 
 
 
2
  /*
3
  * Example 12 - How to create a new customer in the Mollie API.
4
  */
5
+
6
  try {
7
  /*
8
  * Initialize the Mollie API library with your API key or OAuth access token.
9
  */
10
  require "initialize.php";
11
+
12
  /*
13
  * Retrieve the last created customer for this example.
14
  * If no customers are created yet, run example 11.
15
  */
16
  $customer = $mollie->customers->page(null, 1)[0];
17
+
18
  /*
19
  * Generate a unique order id for this example. It is important to include this unique attribute
20
  * in the redirectUrl (below) so a proper return page can be shown to the customer.
21
  */
22
+ $orderId = time();
23
+
24
  /*
25
  * Determine the url parts to these example files.
26
  */
27
+ $protocol = isset($_SERVER['HTTPS']) && strcasecmp('off', $_SERVER['HTTPS']) !== 0 ? "https" : "http";
28
  $hostname = $_SERVER['HTTP_HOST'];
29
+ $path = dirname(isset($_SERVER['REQUEST_URI']) ? $_SERVER['REQUEST_URI'] : $_SERVER['PHP_SELF']);
30
+
31
  /*
32
  * Customer Payment creation parameters.
33
  *
34
  * Linking customers to payments has a few benefits, see:
35
  * https://docs.mollie.com/reference/v2/customers-api/create-customer-payment
36
  */
37
+ $payment = $customer->createPayment([
38
+ "amount" => [
39
+ "value" => "10.00", // You must send the correct number of decimals, thus we enforce the use of strings
40
+ "currency" => "EUR"
41
+ ],
42
+ "description" => "Order #{$orderId}",
43
+ "redirectUrl" => "{$protocol}://{$hostname}{$path}/03-return-page.php?order_id={$orderId}",
44
+ "webhookUrl" => "{$protocol}://{$hostname}{$path}/02-webhook-verification.php",
45
+ "metadata" => [
46
+ "order_id" => $orderId,
47
+ ]
48
+ ]);
49
+
50
  /*
51
  * In this example we store the order with its payment status in a database.
52
  */
53
+ database_write($orderId, $payment->status);
54
+
55
  /*
56
  * Send the customer off to complete the payment.
57
  * This request should always be a GET, thus we enforce 303 http response code
58
  */
59
+ header("Location: " . $payment->getCheckoutUrl(), true, 303);
60
  } catch (\Mollie\Api\Exceptions\ApiException $e) {
61
+ echo "API call failed: " . htmlspecialchars($e->getMessage());
62
  }
63
+
64
  /*
65
  * NOTE: This example uses a text file as a database. Please use a real database like MySQL in production code.
66
  */
67
  function database_write($orderId, $status)
68
  {
69
+ $orderId = intval($orderId);
70
+ $database = dirname(__FILE__) . "/orders/order-{$orderId}.txt";
71
+ file_put_contents($database, $status);
72
  }
includes/mollie-api-php/examples/13-customer-payments-history.php CHANGED
@@ -1,10 +1,8 @@
1
  <?php
2
-
3
- namespace _PhpScoper5b6804f9734c8;
4
-
5
  /*
6
  * Example 13 - How to retrieve your customers' payments history.
7
  */
 
8
  try {
9
  /*
10
  * Initialize the Mollie API library with your API key.
@@ -12,40 +10,49 @@ try {
12
  * See: https://www.mollie.com/dashboard/developers/api-keys
13
  */
14
  require "initialize.php";
 
15
  /*
16
- * Determine the url parts to these example files.
17
- */
18
- $protocol = isset($_SERVER['HTTPS']) && \strcasecmp('off', $_SERVER['HTTPS']) !== 0 ? "https" : "http";
19
  $hostname = $_SERVER['HTTP_HOST'];
20
- $path = \dirname(isset($_SERVER['REQUEST_URI']) ? $_SERVER['REQUEST_URI'] : $_SERVER['PHP_SELF']);
 
21
  /*
22
  * Retrieve the last created customer for this example.
23
  * If no customers are created yet, run example 11.
24
  */
25
  $customer = $mollie->customers->page(null, 1)[0];
 
26
  /*
27
  * Get the all payments for this API key ordered by newest.
28
  */
29
  $payments = $customer->payments();
 
30
  echo "<ul>";
31
  foreach ($payments as $payment) {
32
  echo "<li>";
33
- echo "<strong style='font-family: monospace'>" . \htmlspecialchars($payment->id) . "</strong><br />";
34
- echo \htmlspecialchars($payment->description) . "<br />";
35
- echo \htmlspecialchars($payment->amount->currency) . " " . \htmlspecialchars($payment->amount->value) . "<br />";
36
- echo "Status: " . \htmlspecialchars($payment->status) . "<br />";
 
 
37
  if ($payment->hasRefunds()) {
38
  echo "Payment has been (partially) refunded.<br />";
39
  }
 
40
  if ($payment->hasChargebacks()) {
41
  echo "Payment has been charged back.<br />";
42
  }
 
43
  if ($payment->canBeRefunded() && $payment->amountRemaining->currency === 'EUR' && $payment->amountRemaining->value >= '2.00') {
44
- echo " (<a href=\"{$protocol}://{$hostname}{$path}/07-refund-payment.php?payment_id=" . \htmlspecialchars($payment->id) . "\">refund</a>)";
45
  }
 
46
  echo "</li>";
47
  }
48
  echo "</ul>";
49
  } catch (\Mollie\Api\Exceptions\ApiException $e) {
50
- echo "API call failed: " . \htmlspecialchars($e->getMessage());
51
- }
1
  <?php
 
 
 
2
  /*
3
  * Example 13 - How to retrieve your customers' payments history.
4
  */
5
+
6
  try {
7
  /*
8
  * Initialize the Mollie API library with your API key.
10
  * See: https://www.mollie.com/dashboard/developers/api-keys
11
  */
12
  require "initialize.php";
13
+
14
  /*
15
+ * Determine the url parts to these example files.
16
+ */
17
+ $protocol = isset($_SERVER['HTTPS']) && strcasecmp('off', $_SERVER['HTTPS']) !== 0 ? "https" : "http";
18
  $hostname = $_SERVER['HTTP_HOST'];
19
+ $path = dirname(isset($_SERVER['REQUEST_URI']) ? $_SERVER['REQUEST_URI'] : $_SERVER['PHP_SELF']);
20
+
21
  /*
22
  * Retrieve the last created customer for this example.
23
  * If no customers are created yet, run example 11.
24
  */
25
  $customer = $mollie->customers->page(null, 1)[0];
26
+
27
  /*
28
  * Get the all payments for this API key ordered by newest.
29
  */
30
  $payments = $customer->payments();
31
+
32
  echo "<ul>";
33
  foreach ($payments as $payment) {
34
  echo "<li>";
35
+ echo "<strong style='font-family: monospace'>" . htmlspecialchars($payment->id) . "</strong><br />";
36
+ echo htmlspecialchars($payment->description) . "<br />";
37
+ echo htmlspecialchars($payment->amount->currency) . " " . htmlspecialchars($payment->amount->value) . "<br />";
38
+
39
+ echo "Status: " . htmlspecialchars($payment->status) . "<br />";
40
+
41
  if ($payment->hasRefunds()) {
42
  echo "Payment has been (partially) refunded.<br />";
43
  }
44
+
45
  if ($payment->hasChargebacks()) {
46
  echo "Payment has been charged back.<br />";
47
  }
48
+
49
  if ($payment->canBeRefunded() && $payment->amountRemaining->currency === 'EUR' && $payment->amountRemaining->value >= '2.00') {
50
+ echo " (<a href=\"{$protocol}://{$hostname}{$path}/07-refund-payment.php?payment_id=" . htmlspecialchars($payment->id) . "\">refund</a>)";
51
  }
52
+
53
  echo "</li>";
54
  }
55
  echo "</ul>";
56
  } catch (\Mollie\Api\Exceptions\ApiException $e) {
57
+ echo "API call failed: " . htmlspecialchars($e->getMessage());
58
+ }
includes/mollie-api-php/examples/14-recurring-first-payment.php CHANGED
@@ -1,31 +1,33 @@
1
  <?php
2
-
3
- namespace _PhpScoper5b6804f9734c8;
4
-
5
  /*
6
  * Example 14 - How to create a first payment to allow recurring payments later.
7
  */
 
8
  try {
9
  /*
10
  * Initialize the Mollie API library with your API key or OAuth access token.
11
  */
12
  require "initialize.php";
 
13
  /*
14
  * Retrieve the last created customer for this example.
15
  * If no customers are created yet, run example 11.
16
  */
17
  $customer = $mollie->customers->page(null, 1)[0];
 
18
  /*
19
  * Generate a unique order id for this example. It is important to include this unique attribute
20
  * in the redirectUrl (below) so a proper return page can be shown to the customer.
21
  */
22
- $orderId = \time();
 
23
  /*
24
  * Determine the url parts to these example files.
25
  */
26
- $protocol = isset($_SERVER['HTTPS']) && \strcasecmp('off', $_SERVER['HTTPS']) !== 0 ? "https" : "http";
27
  $hostname = $_SERVER['HTTP_HOST'];
28
- $path = \dirname(isset($_SERVER['REQUEST_URI']) ? $_SERVER['REQUEST_URI'] : $_SERVER['PHP_SELF']);
 
29
  /*
30
  * Customer Payment creation parameters.
31
  *
@@ -33,21 +35,25 @@ try {
33
  */
34
  $payment = $customer->createPayment([
35
  "amount" => [
36
- "value" => "10.00",
37
- // You must send the correct number of decimals, thus we enforce the use of strings
38
- "currency" => "EUR",
39
  ],
40
  "description" => "First payment - Order #{$orderId}",
41
  "redirectUrl" => "{$protocol}://{$hostname}{$path}/03-return-page.php?order_id={$orderId}",
42
  "webhookUrl" => "{$protocol}://{$hostname}{$path}/02-webhook-verification.php",
43
- "metadata" => ["order_id" => $orderId],
 
 
 
44
  // Flag this payment as a first payment to allow recurring payments later.
45
  "sequenceType" => \Mollie\Api\Types\SequenceType::SEQUENCETYPE_FIRST,
46
  ]);
 
47
  /*
48
  * In this example we store the order with its payment status in a database.
49
  */
50
- \_PhpScoper5b6804f9734c8\database_write($orderId, $payment->status);
 
51
  /*
52
  * Send the customer off to complete the payment.
53
  * This request should always be a GET, thus we enforce 303 http response code
@@ -55,16 +61,17 @@ try {
55
  * After completion, the customer will have a pending or valid mandate that can be
56
  * used for recurring payments and subscriptions.
57
  */
58
- \header("Location: " . $payment->getCheckoutUrl(), \true, 303);
59
  } catch (\Mollie\Api\Exceptions\ApiException $e) {
60
- echo "API call failed: " . \htmlspecialchars($e->getMessage());
61
  }
 
62
  /*
63
  * NOTE: This example uses a text file as a database. Please use a real database like MySQL in production code.
64
  */
65
  function database_write($orderId, $status)
66
  {
67
- $orderId = \intval($orderId);
68
- $database = \dirname(__FILE__) . "/orders/order-{$orderId}.txt";
69
- \file_put_contents($database, $status);
70
  }
1
  <?php
 
 
 
2
  /*
3
  * Example 14 - How to create a first payment to allow recurring payments later.
4
  */
5
+
6
  try {
7
  /*
8
  * Initialize the Mollie API library with your API key or OAuth access token.
9
  */
10
  require "initialize.php";
11
+
12
  /*
13
  * Retrieve the last created customer for this example.
14
  * If no customers are created yet, run example 11.
15
  */
16
  $customer = $mollie->customers->page(null, 1)[0];
17
+
18
  /*
19
  * Generate a unique order id for this example. It is important to include this unique attribute
20
  * in the redirectUrl (below) so a proper return page can be shown to the customer.
21
  */
22
+ $orderId = time();
23
+
24
  /*
25
  * Determine the url parts to these example files.
26
  */
27
+ $protocol = isset($_SERVER['HTTPS']) && strcasecmp('off', $_SERVER['HTTPS']) !== 0 ? "https" : "http";
28
  $hostname = $_SERVER['HTTP_HOST'];
29
+ $path = dirname(isset($_SERVER['REQUEST_URI']) ? $_SERVER['REQUEST_URI'] : $_SERVER['PHP_SELF']);
30
+
31
  /*
32
  * Customer Payment creation parameters.
33
  *
35
  */
36
  $payment = $customer->createPayment([
37
  "amount" => [
38
+ "value" => "10.00", // You must send the correct number of decimals, thus we enforce the use of strings
39
+ "currency" => "EUR"
 
40
  ],
41
  "description" => "First payment - Order #{$orderId}",
42
  "redirectUrl" => "{$protocol}://{$hostname}{$path}/03-return-page.php?order_id={$orderId}",
43
  "webhookUrl" => "{$protocol}://{$hostname}{$path}/02-webhook-verification.php",
44
+ "metadata" => [
45
+ "order_id" => $orderId,
46
+ ],
47
+
48
  // Flag this payment as a first payment to allow recurring payments later.
49
  "sequenceType" => \Mollie\Api\Types\SequenceType::SEQUENCETYPE_FIRST,
50
  ]);
51
+
52
  /*
53
  * In this example we store the order with its payment status in a database.
54
  */
55
+ database_write($orderId, $payment->status);
56
+
57
  /*
58
  * Send the customer off to complete the payment.
59
  * This request should always be a GET, thus we enforce 303 http response code
61
  * After completion, the customer will have a pending or valid mandate that can be
62
  * used for recurring payments and subscriptions.
63
  */
64
+ header("Location: " . $payment->getCheckoutUrl(), true, 303);
65
  } catch (\Mollie\Api\Exceptions\ApiException $e) {
66
+ echo "API call failed: " . htmlspecialchars($e->getMessage());
67
  }
68
+
69
  /*
70
  * NOTE: This example uses a text file as a database. Please use a real database like MySQL in production code.
71
  */
72
  function database_write($orderId, $status)
73
  {
74
+ $orderId = intval($orderId);
75
+ $database = dirname(__FILE__) . "/orders/order-{$orderId}.txt";
76
+ file_put_contents($database, $status);
77
  }
includes/mollie-api-php/examples/15-recurring-payment.php CHANGED
@@ -1,30 +1,32 @@
1
  <?php
2
-
3
- namespace _PhpScoper5b6804f9734c8;
4
-
5
  /*
6
  * Example 15 - How to create an on-demand recurring payment.
7
  */
 
8
  try {
9
  /*
10
  * Initialize the Mollie API library with your API key or OAuth access token.
11
  */
12
  require "initialize.php";
 
13
  /*
14
  * Retrieve the last created customer for this example.
15
  * If no customers are created yet, run example 11.
16
  */
17
  $customer = $mollie->customers->page(null, 1)[0];
 
18
  /*
19
  * Generate a unique order id for this example.
20
  */
21
- $orderId = \time();
 
22
  /*
23
  * Determine the url parts to these example files.
24
  */
25
- $protocol = isset($_SERVER['HTTPS']) && \strcasecmp('off', $_SERVER['HTTPS']) !== 0 ? "https" : "http";
26
  $hostname = $_SERVER['HTTP_HOST'];
27
- $path = \dirname(isset($_SERVER['REQUEST_URI']) ? $_SERVER['REQUEST_URI'] : $_SERVER['PHP_SELF']);
 
28
  /*
29
  * Customer Payment creation parameters.
30
  *
@@ -32,35 +34,40 @@ try {
32
  */
33
  $payment = $customer->createPayment([
34
  "amount" => [
35
- "value" => "10.00",
36
- // You must send the correct number of decimals, thus we enforce the use of strings
37
- "currency" => "EUR",
38
  ],
39
  "description" => "On-demand payment - Order #{$orderId}",
40
  "webhookUrl" => "{$protocol}://{$hostname}{$path}/02-webhook-verification.php",
41
- "metadata" => ["order_id" => $orderId],
 
 
 
42
  // Flag this payment as a recurring payment.
43
  "sequenceType" => \Mollie\Api\Types\SequenceType::SEQUENCETYPE_RECURRING,
44
  ]);
 
45
  /*
46
  * In this example we store the order with its payment status in a database.
47
  */
48
- \_PhpScoper5b6804f9734c8\database_write($orderId, $payment->status);
 
49
  /*
50
  * The payment will be either pending or paid immediately. The customer
51
  * does not have to perform any payment steps.
52
  */
53
- echo "<p>Selected mandate is '" . \htmlspecialchars($payment->mandateId) . "' (" . \htmlspecialchars($payment->method) . ").</p>\n";
54
- echo "<p>The payment status is '" . \htmlspecialchars($payment->status) . "'.</p>\n";
55
  } catch (\Mollie\Api\Exceptions\ApiException $e) {
56
- echo "API call failed: " . \htmlspecialchars($e->getMessage());
57
  }
 
58
  /*
59
  * NOTE: This example uses a text file as a database. Please use a real database like MySQL in production code.
60
  */
61
  function database_write($orderId, $status)
62
  {
63
- $orderId = \intval($orderId);
64
- $database = \dirname(__FILE__) . "/orders/order-{$orderId}.txt";
65
- \file_put_contents($database, $status);
66
  }
1
  <?php
 
 
 
2
  /*
3
  * Example 15 - How to create an on-demand recurring payment.
4
  */
5
+
6
  try {
7
  /*
8
  * Initialize the Mollie API library with your API key or OAuth access token.
9
  */
10
  require "initialize.php";
11
+
12
  /*
13
  * Retrieve the last created customer for this example.
14
  * If no customers are created yet, run example 11.
15
  */
16
  $customer = $mollie->customers->page(null, 1)[0];
17
+
18
  /*
19
  * Generate a unique order id for this example.
20
  */
21
+ $orderId = time();
22
+
23
  /*
24
  * Determine the url parts to these example files.
25
  */
26
+ $protocol = isset($_SERVER['HTTPS']) && strcasecmp('off', $_SERVER['HTTPS']) !== 0 ? "https" : "http";
27
  $hostname = $_SERVER['HTTP_HOST'];
28
+ $path = dirname(isset($_SERVER['REQUEST_URI']) ? $_SERVER['REQUEST_URI'] : $_SERVER['PHP_SELF']);
29
+
30
  /*
31
  * Customer Payment creation parameters.
32
  *
34
  */
35
  $payment = $customer->createPayment([
36
  "amount" => [
37
+ "value" => "10.00", // You must send the correct number of decimals, thus we enforce the use of strings
38
+ "currency" => "EUR"
 
39
  ],
40
  "description" => "On-demand payment - Order #{$orderId}",
41
  "webhookUrl" => "{$protocol}://{$hostname}{$path}/02-webhook-verification.php",
42
+ "metadata" => [
43
+ "order_id" => $orderId,
44
+ ],
45
+
46
  // Flag this payment as a recurring payment.
47
  "sequenceType" => \Mollie\Api\Types\SequenceType::SEQUENCETYPE_RECURRING,
48
  ]);
49
+
50
  /*
51
  * In this example we store the order with its payment status in a database.
52
  */
53
+ database_write($orderId, $payment->status);
54
+
55
  /*
56
  * The payment will be either pending or paid immediately. The customer
57
  * does not have to perform any payment steps.
58
  */
59
+ echo "<p>Selected mandate is '" . htmlspecialchars($payment->mandateId) . "' (" . htmlspecialchars($payment->method) . ").</p>\n";
60
+ echo "<p>The payment status is '" . htmlspecialchars($payment->status) . "'.</p>\n";
61
  } catch (\Mollie\Api\Exceptions\ApiException $e) {
62
+ echo "API call failed: " . htmlspecialchars($e->getMessage());
63
  }
64
+
65
  /*
66
  * NOTE: This example uses a text file as a database. Please use a real database like MySQL in production code.
67
  */
68
  function database_write($orderId, $status)
69
  {
70
+ $orderId = intval($orderId);
71
+ $database = dirname(__FILE__) . "/orders/order-{$orderId}.txt";
72
+ file_put_contents($database, $status);
73
  }
includes/mollie-api-php/examples/16-recurring-subscription.php CHANGED
@@ -1,10 +1,8 @@
1
  <?php
2
-
3
- namespace _PhpScoper5b6804f9734c8;
4
-
5
  /*
6
  * Example 16 - How to create a regular subscription.
7
  */
 
8
  try {
9
  /*
10
  * Initialize the Mollie API library with your API key or OAuth access token.
@@ -13,9 +11,10 @@ try {
13
  /*
14
  * Determine the url parts to these example files.
15
  */
16
- $protocol = isset($_SERVER['HTTPS']) && \strcasecmp('off', $_SERVER['HTTPS']) !== 0 ? "https" : "http";
17
  $hostname = $_SERVER['HTTP_HOST'];
18
- $path = \dirname(isset($_SERVER['REQUEST_URI']) ? $_SERVER['REQUEST_URI'] : $_SERVER['PHP_SELF']);
 
19
  /**
20
  * Retrieve the last created customer for this example.
21
  * If no customers are created yet, run example 11.
@@ -25,26 +24,32 @@ try {
25
  * Generate a unique subscription id for this example. It is important to include this unique attribute
26
  * in the webhookUrl (below) so new payments can be associated with this subscription.
27
  */
28
- $subscriptionId = \time();
29
  /*
30
  * Customer Subscription creation parameters.
31
  *
32
  * See: https://www.mollie.com/nl/docs/reference/subscriptions/create
33
  */
34
- $subscription = $customer->createSubscription(["amount" => [
35
- "value" => "10.00",
36
- // You must send the correct number of decimals, thus we enforce the use of strings
37
- "currency" => "EUR",
38
- ], "times" => 12, "interval" => "1 month", "description" => "Subscription #{$subscriptionId}", "method" => \NULL, "webhookUrl" => "https://example.com/webhook.php?subscription_id={$subscriptionId}"]);
 
 
 
 
 
 
39
  /*
40
  * The subscription will be either pending or active depending on whether the customer has
41
  * a pending or valid mandate. If the customer has no mandates an error is returned. You
42
  * should then set up a "first payment" for the customer (example 14).
43
  */
44
- echo "<p>The subscription status is '" . \htmlspecialchars($subscription->status) . "'.</p>\n";
45
  echo "<p>";
46
  echo '<a href="' . $protocol . '://' . $hostname . $path . '/17-cancel-subscription.php?subscription_id=' . $subscription->id . '">18-cancel-subscription</a><br>';
47
  echo "</p>";
48
  } catch (\Mollie\Api\Exceptions\ApiException $e) {
49
- echo "API call failed: " . \htmlspecialchars($e->getMessage());
50
- }
1
  <?php
 
 
 
2
  /*
3
  * Example 16 - How to create a regular subscription.
4
  */
5
+
6
  try {
7
  /*
8
  * Initialize the Mollie API library with your API key or OAuth access token.
11
  /*
12
  * Determine the url parts to these example files.
13
  */
14
+ $protocol = isset($_SERVER['HTTPS']) && strcasecmp('off', $_SERVER['HTTPS']) !== 0 ? "https" : "http";
15
  $hostname = $_SERVER['HTTP_HOST'];
16
+ $path = dirname(isset($_SERVER['REQUEST_URI']) ? $_SERVER['REQUEST_URI'] : $_SERVER['PHP_SELF']);
17
+
18
  /**
19
  * Retrieve the last created customer for this example.
20
  * If no customers are created yet, run example 11.
24
  * Generate a unique subscription id for this example. It is important to include this unique attribute
25
  * in the webhookUrl (below) so new payments can be associated with this subscription.
26
  */
27
+ $subscriptionId = time();
28
  /*
29
  * Customer Subscription creation parameters.
30
  *
31
  * See: https://www.mollie.com/nl/docs/reference/subscriptions/create
32
  */
33
+ $subscription = $customer->createSubscription([
34
+ "amount" => [
35
+ "value" => "10.00", // You must send the correct number of decimals, thus we enforce the use of strings
36
+ "currency" => "EUR"
37
+ ],
38
+ "times" => 12,
39
+ "interval" => "1 month",
40
+ "description" => "Subscription #{$subscriptionId}",
41
+ "method" => NULL,
42
+ "webhookUrl" => "https://example.com/webhook.php?subscription_id={$subscriptionId}",
43
+ ]);
44
  /*
45
  * The subscription will be either pending or active depending on whether the customer has
46
  * a pending or valid mandate. If the customer has no mandates an error is returned. You
47
  * should then set up a "first payment" for the customer (example 14).
48
  */
49
+ echo "<p>The subscription status is '" . htmlspecialchars($subscription->status) . "'.</p>\n";
50
  echo "<p>";
51
  echo '<a href="' . $protocol . '://' . $hostname . $path . '/17-cancel-subscription.php?subscription_id=' . $subscription->id . '">18-cancel-subscription</a><br>';
52
  echo "</p>";
53
  } catch (\Mollie\Api\Exceptions\ApiException $e) {
54
+ echo "API call failed: " . htmlspecialchars($e->getMessage());
55
+ }
includes/mollie-api-php/examples/17-cancel-subscription.php CHANGED
@@ -1,10 +1,8 @@
1
  <?php
2
-
3
- namespace _PhpScoper5b6804f9734c8;
4
-
5
  /*
6
  * Example 17 - How to cancel a subscription.
7
  */
 
8
  try {
9
  /*
10
  * Initialize the Mollie API library with your API key or OAuth access token.
@@ -29,7 +27,7 @@ try {
29
  /*
30
  * The subscription status should now be canceled
31
  */
32
- echo "<p>The subscription status is now: '" . \htmlspecialchars($canceledSubscription->status) . "'.</p>\n";
33
  } catch (\Mollie\Api\Exceptions\ApiException $e) {
34
- echo "API call failed: " . \htmlspecialchars($e->getMessage());
35
- }
1
  <?php
 
 
 
2
  /*
3
  * Example 17 - How to cancel a subscription.
4
  */
5
+
6
  try {
7
  /*
8
  * Initialize the Mollie API library with your API key or OAuth access token.
27
  /*
28
  * The subscription status should now be canceled
29
  */
30
+ echo "<p>The subscription status is now: '" . htmlspecialchars($canceledSubscription->status) . "'.</p>\n";
31
  } catch (\Mollie\Api\Exceptions\ApiException $e) {
32
+ echo "API call failed: " . htmlspecialchars($e->getMessage());
33
+ }
includes/mollie-api-php/examples/18-update-customer.php CHANGED
@@ -1,10 +1,8 @@
1
  <?php
2
-
3
- namespace _PhpScoper5b6804f9734c8;
4
-
5
  /*
6
  * Example 18 - Updating an existing customer via the Mollie API.
7
  */
 
8
  try {
9
  /*
10
  * Initialize the Mollie API library with your API key or OAuth access token.
@@ -22,9 +20,10 @@ try {
22
  $customer->name = "Luke Sky";
23
  $customer->email = "luke@example.org";
24
  $customer->locale = "en_US";
25
- $customer->metadata->isJedi = \TRUE;
26
  $customer->update();
27
- echo "<p>Customer updated: " . \htmlspecialchars($customer->name) . "</p>";
 
28
  } catch (\Mollie\Api\Exceptions\ApiException $e) {
29
- echo "API call failed: " . \htmlspecialchars($e->getMessage());
30
- }
1
  <?php
 
 
 
2
  /*
3
  * Example 18 - Updating an existing customer via the Mollie API.
4
  */
5
+
6
  try {
7
  /*
8
  * Initialize the Mollie API library with your API key or OAuth access token.
20
  $customer->name = "Luke Sky";
21
  $customer->email = "luke@example.org";
22
  $customer->locale = "en_US";
23
+ $customer->metadata->isJedi = TRUE;
24
  $customer->update();
25
+
26
+ echo "<p>Customer updated: " . htmlspecialchars($customer->name) . "</p>";
27
  } catch (\Mollie\Api\Exceptions\ApiException $e) {
28
+ echo "API call failed: " . htmlspecialchars($e->getMessage());
29
+ }
includes/mollie-api-php/examples/19-update-profile.php CHANGED
@@ -1,11 +1,9 @@
1
  <?php
2
-
3
- namespace _PhpScoper5b6804f9734c8;
4
-
5
  /*
6
  * Example 19 - Updating an existing profile via the Mollie API.
7
  */
8
- try {
 
9
  /*
10
  * Initialize the Mollie API library with your API key or OAuth access token.
11
  */
@@ -19,13 +17,15 @@ try {
19
  *
20
  * @See https://docs.mollie.com/reference/v2/profiles-api/update-profile
21
  */
22
- $profile->name = "Mollie B.V.";
23
  $profile->website = 'www.mollie.com';
24
- $profile->email = 'info@mollie.com';
25
- $profile->phone = '0612345670';
26
  $profile->categoryCode = 5399;
27
  $profile->update();
28
- echo "<p>Profile updated: " . \htmlspecialchars($profile->name) . "</p>";
29
- } catch (\Mollie\Api\Exceptions\ApiException $e) {
30
- echo "<p>API call failed: " . \htmlspecialchars($e->getMessage()) . "</p>";
31
  }
 
 
 
 
1
  <?php
 
 
 
2
  /*
3
  * Example 19 - Updating an existing profile via the Mollie API.
4
  */
5
+ try
6
+ {
7
  /*
8
  * Initialize the Mollie API library with your API key or OAuth access token.
9
  */
17
  *
18
  * @See https://docs.mollie.com/reference/v2/profiles-api/update-profile
19
  */
20
+ $profile->name = "Mollie B.V.";
21
  $profile->website = 'www.mollie.com';
22
+ $profile->email = 'info@mollie.com';
23
+ $profile->phone = '0612345670';
24
  $profile->categoryCode = 5399;
25
  $profile->update();
26
+ echo "<p>Profile updated: " . htmlspecialchars($profile->name) . "</p>";
 
 
27
  }
28
+ catch (\Mollie\Api\Exceptions\ApiException $e)
29
+ {
30
+ echo "<p>API call failed: " . htmlspecialchars($e->getMessage()) . "</p>";
31
+ }
includes/mollie-api-php/examples/20-list-invoices.php CHANGED
@@ -1,37 +1,37 @@
1
  <?php
2
-
3
- namespace _PhpScoper5b6804f9734c8;
4
-
5
  /*
6
  * Example 22 - Create a customer, mandate and subscription via the Mollie API.
7
  */
 
8
  try {
9
  /*
10
  * Initialize the Mollie API library with your API key or OAuth access token.
11
  */
12
  require "initialize_with_oauth.php";
 
13
  /*
14
- * Get all the activated methods for this API key.
15
- */
16
  $invoices = $mollie->invoices->all();
17
  foreach ($invoices as $invoice) {
18
- echo '<li><b>Invoice ' . \htmlspecialchars($invoice->reference) . ':</b> (' . \htmlspecialchars($invoice->issuedAt) . ')';
19
  echo '<br>Status: <b>' . $invoice->status;
20
  echo '<table border="1"><tr><th>Period</th><th>Description</th><th>Count</th><th>VAT Percentage</th><th>Amount</th></tr>';
21
  foreach ($invoice->lines as $line) {
22
  echo '<tr>';
23
- echo '<td>' . \htmlspecialchars($line->period) . '</td>';
24
- echo '<td>' . \htmlspecialchars($line->description) . '</td>';
25
- echo '<td align="right">' . \htmlspecialchars($line->count) . '</td>';
26
- echo '<td align="right">' . \htmlspecialchars($line->vatPercentage) . '</td>';
27
- echo '<td align="right">' . \htmlspecialchars($line->amount->currency . " " . $line->amount->value) . '</td>';
28
  echo '</tr>';
29
  }
30
- echo '<tr><th colspan="5" align="right">Gross Total</th><th align="right">' . \htmlspecialchars($invoice->grossAmount->value . " " . $invoice->grossAmount->currency) . '</th></tr>';
31
  echo '</table>';
32
- echo '<a href="' . $invoice->_links->pdf->href . '" target="_blank">Click here to open PDF</a>';
33
  echo '</li>';
34
  }
 
35
  } catch (\Mollie\Api\Exceptions\ApiException $e) {
36
- echo "API call failed: " . \htmlspecialchars($e->getMessage());
37
- }
1
  <?php
 
 
 
2
  /*
3
  * Example 22 - Create a customer, mandate and subscription via the Mollie API.
4
  */
5
+
6
  try {
7
  /*
8
  * Initialize the Mollie API library with your API key or OAuth access token.
9
  */
10
  require "initialize_with_oauth.php";
11
+
12
  /*
13
+ * Get all the activated methods for this API key.
14
+ */
15
  $invoices = $mollie->invoices->all();
16
  foreach ($invoices as $invoice) {
17
+ echo '<li><b>Invoice ' . htmlspecialchars($invoice->reference) . ':</b> (' . htmlspecialchars($invoice->issuedAt) . ')';
18
  echo '<br>Status: <b>' . $invoice->status;
19
  echo '<table border="1"><tr><th>Period</th><th>Description</th><th>Count</th><th>VAT Percentage</th><th>Amount</th></tr>';
20
  foreach ($invoice->lines as $line) {
21
  echo '<tr>';
22
+ echo '<td>' . htmlspecialchars($line->period) . '</td>';
23
+ echo '<td>' . htmlspecialchars($line->description) . '</td>';
24
+ echo '<td align="right">' . htmlspecialchars($line->count) . '</td>';
25
+ echo '<td align="right">' . htmlspecialchars($line->vatPercentage) . '</td>';
26
+ echo '<td align="right">' . htmlspecialchars($line->amount->currency . " " . $line->amount->value) . '</td>';
27
  echo '</tr>';
28
  }
29
+ echo '<tr><th colspan="5" align="right">Gross Total</th><th align="right">' . htmlspecialchars($invoice->grossAmount->value . " " . $invoice->grossAmount->currency) . '</th></tr>';
30
  echo '</table>';
31
+ echo '<a href="'. $invoice->_links->pdf->href .'" target="_blank">Click here to open PDF</a>';
32
  echo '</li>';
33
  }
34
+
35
  } catch (\Mollie\Api\Exceptions\ApiException $e) {
36
+ echo "API call failed: " . htmlspecialchars($e->getMessage());
37
+ }
includes/mollie-api-php/examples/22-create-mandate-subscription.php CHANGED
@@ -1,44 +1,55 @@
1
  <?php
2
-
3
- namespace _PhpScoper5b6804f9734c8;
4
-
5
  /*
6
  * Example 22 - Create a customer, mandate and subscription via the Mollie API.
7
  */
 
8
  try {
9
  /*
10
  * Initialize the Mollie API library with your API key or OAuth access token.
11
  */
12
  require "initialize.php";
 
13
  /*
14
  * Customer creation parameters.
15
  *
16
  * See: https://docs.mollie.com/reference/v2/customers-api/create-customer
17
  */
18
- $customer = $mollie->customers->create(["name" => 'Example name', "email" => 'info@example.com']);
 
 
 
 
19
  echo "<p>Customer created with id " . $customer->id . "</p>";
20
- $mandate = $customer->createMandate(["method" => \Mollie\Api\Types\MandateMethod::DIRECTDEBIT, "consumerAccount" => 'NL34ABNA0243341423', "consumerName" => 'B. A. Example']);
 
 
 
 
 
 
21
  echo "<p>Mandate created with id " . $mandate->id . "</p>";
 
22
  /*
23
  * Generate a unique subscription id for this example. It is important to include this unique attribute
24
  * in the webhookUrl (below) so new payments can be associated with this subscription.
25
  */
26
- $subscriptionId = \time();
 
27
  $subscription = $customer->createSubscription([
28
  "amount" => [
29
- "value" => "10.00",
30
- // You must send the correct number of decimals, thus we enforce the use of strings
31
- "currency" => "EUR",
32
  ],
33
- "times" => 12,
34
- // recurring membership for 1 year
35
- "interval" => "1 months",
36
- // every month
37
  "description" => "Subscription #{$subscriptionId}",
38
  "webhookUrl" => "https://example.com/webhook.php?subscription_id={$subscriptionId}",
39
- "metadata" => ["subscription_id" => $subscriptionId],
 
 
40
  ]);
 
41
  echo "<p>Subscription created with id " . $subscription->id . "</p>";
42
  } catch (\Mollie\Api\Exceptions\ApiException $e) {
43
- echo "API call failed: " . \htmlspecialchars($e->getMessage());
44
- }
1
  <?php
 
 
 
2
  /*
3
  * Example 22 - Create a customer, mandate and subscription via the Mollie API.
4
  */
5
+
6
  try {
7
  /*
8
  * Initialize the Mollie API library with your API key or OAuth access token.
9
  */
10
  require "initialize.php";
11
+
12
  /*
13
  * Customer creation parameters.
14
  *
15
  * See: https://docs.mollie.com/reference/v2/customers-api/create-customer
16
  */
17
+ $customer = $mollie->customers->create([
18
+ "name" => 'Example name',
19
+ "email" => 'info@example.com',
20
+ ]);
21
+
22
  echo "<p>Customer created with id " . $customer->id . "</p>";
23
+
24
+ $mandate = $customer->createMandate([
25
+ "method" => \Mollie\Api\Types\MandateMethod::DIRECTDEBIT,
26
+ "consumerAccount" => 'NL34ABNA0243341423',
27
+ "consumerName" => 'B. A. Example',
28
+ ]);
29
+
30
  echo "<p>Mandate created with id " . $mandate->id . "</p>";
31
+
32
  /*
33
  * Generate a unique subscription id for this example. It is important to include this unique attribute
34
  * in the webhookUrl (below) so new payments can be associated with this subscription.
35
  */
36
+ $subscriptionId = time();
37
+
38
  $subscription = $customer->createSubscription([
39
  "amount" => [
40
+ "value" => "10.00", // You must send the correct number of decimals, thus we enforce the use of strings
41
+ "currency" => "EUR"
 
42
  ],
43
+ "times" => 12, // recurring membership for 1 year
44
+ "interval" => "1 months", // every month
 
 
45
  "description" => "Subscription #{$subscriptionId}",
46
  "webhookUrl" => "https://example.com/webhook.php?subscription_id={$subscriptionId}",
47
+ "metadata" => [
48
+ "subscription_id" => $subscriptionId,
49
+ ],
50
  ]);
51
+
52
  echo "<p>Subscription created with id " . $subscription->id . "</p>";
53
  } catch (\Mollie\Api\Exceptions\ApiException $e) {
54
+ echo "API call failed: " . htmlspecialchars($e->getMessage());
55
+ }
includes/mollie-api-php/examples/23-delete-customer.php CHANGED
@@ -1,17 +1,17 @@
1
  <?php
2
-
3
- namespace _PhpScoper5b6804f9734c8;
4
-
5
  /*
6
  Example 23 - Delete a customer from mollie api.
7
  */
 
8
  try {
9
  /*
10
  * Initialize the Mollie API library with your API key or OAuth access token.
11
  */
12
  require "initialize.php";
 
13
  $mollie->customers->delete("customer_id");
14
  echo "Customer deleted!";
 
15
  } catch (\Mollie\Api\Exceptions\ApiException $e) {
16
- echo "API call failed: " . \htmlspecialchars($e->getMessage());
17
  }
1
  <?php
 
 
 
2
  /*
3
  Example 23 - Delete a customer from mollie api.
4
  */
5
+
6
  try {
7
  /*
8
  * Initialize the Mollie API library with your API key or OAuth access token.
9
  */
10
  require "initialize.php";
11
+
12
  $mollie->customers->delete("customer_id");
13
  echo "Customer deleted!";
14
+
15
  } catch (\Mollie\Api\Exceptions\ApiException $e) {
16
+ echo "API call failed: " . htmlspecialchars($e->getMessage());
17
  }
includes/mollie-api-php/examples/24-revoke-mandate.php CHANGED
@@ -1,28 +1,31 @@
1
  <?php
2
-
3
- namespace _PhpScoper5b6804f9734c8;
4
-
5
  /*
6
  Example 24 - Revoke a customer mandate
7
  */
 
8
  try {
9
  /*
10
  * Initialize the Mollie API library with your API key or OAuth access token.
11
  */
12
  require "initialize.php";
 
13
  /*
14
  * Retrieve an existing customer by his customerId
15
  */
16
  $customer = $mollie->customers->get("cst_cUa8HjKBus");
 
17
  /*
18
  * Retrieve an existing mandate by his mandateId
19
  */
20
  $mandate = $customer->getMandate("mdt_pa3s7rGnrC");
 
21
  /*
22
  * Revoke the mandate
23
  */
24
  $mandate->revoke();
 
25
  echo "<p>Mandate has been successfully revoked.</p>";
 
26
  } catch (\Mollie\Api\Exceptions\ApiException $e) {
27
- echo "API call failed: " . \htmlspecialchars($e->getMessage());
28
  }
1
  <?php
 
 
 
2
  /*
3
  Example 24 - Revoke a customer mandate
4
  */
5
+
6
  try {
7
  /*
8
  * Initialize the Mollie API library with your API key or OAuth access token.
9
  */
10
  require "initialize.php";
11
+
12
  /*
13
  * Retrieve an existing customer by his customerId
14
  */
15
  $customer = $mollie->customers->get("cst_cUa8HjKBus");
16
+
17
  /*
18
  * Retrieve an existing mandate by his mandateId
19
  */
20
  $mandate = $customer->getMandate("mdt_pa3s7rGnrC");
21
+
22
  /*
23
  * Revoke the mandate
24
  */
25
  $mandate->revoke();
26
+
27
  echo "<p>Mandate has been successfully revoked.</p>";
28
+
29
  } catch (\Mollie\Api\Exceptions\ApiException $e) {
30
+ echo "API call failed: " . htmlspecialchars($e->getMessage());
31
  }
includes/mollie-api-php/examples/25-update-subscription.php CHANGED
@@ -1,34 +1,36 @@
1
  <?php
2
 
3
- namespace _PhpScoper5b6804f9734c8;
4
-
5
  /*
6
  * Example 25 - Updating an existing subscription via the Mollie API.
7
  */
 
8
  use Mollie\Api\Exceptions\ApiException;
 
9
  try {
10
  /*
11
  * Initialize the Mollie API library with your API key or OAuth access token.
12
  */
13
  require "./initialize.php";
 
14
  /*
15
  * Retrieve an existing subscription
16
  */
17
  $customer = $mollie->customers->get("cst_cUe8HjeBuz");
18
  $subscription = $customer->getSubscription("sub_DRjwaT5qHx");
 
19
  /**
20
  * Subscription fields that can be updated are described by the link:
21
  * See https://docs.mollie.com/reference/v2/subscriptions-api/update-subscription
22
  */
23
  $subscription->interval = '2 months';
24
  $subscription->times = 10;
25
- $subscription->startDate = '2018-12-02';
26
- // Year-month-day
27
- $subscription->amount = (object) ['value' => '12.12', 'currency' => 'EUR'];
28
  $subscription->webhookUrl = 'https://some-webhook-url.com/with/path';
29
  $subscription->description = 'Monthly subscription';
30
  $subscription->update();
 
31
  echo "<p>Subscription updated: " . $subscription->id . "</p>";
32
- } catch (\Mollie\Api\Exceptions\ApiException $e) {
33
- echo "API call failed: " . \htmlspecialchars($e->getMessage());
34
- }
1
  <?php
2
 
 
 
3
  /*
4
  * Example 25 - Updating an existing subscription via the Mollie API.
5
  */
6
+
7
  use Mollie\Api\Exceptions\ApiException;
8
+
9
  try {
10
  /*
11
  * Initialize the Mollie API library with your API key or OAuth access token.
12
  */
13
  require "./initialize.php";
14
+
15
  /*
16
  * Retrieve an existing subscription
17
  */
18
  $customer = $mollie->customers->get("cst_cUe8HjeBuz");
19
  $subscription = $customer->getSubscription("sub_DRjwaT5qHx");
20
+
21
  /**
22
  * Subscription fields that can be updated are described by the link:
23
  * See https://docs.mollie.com/reference/v2/subscriptions-api/update-subscription
24
  */
25
  $subscription->interval = '2 months';
26
  $subscription->times = 10;
27
+ $subscription->startDate = '2018-12-02'; // Year-month-day
28
+ $subscription->amount = (object)['value' => '12.12', 'currency' => 'EUR'];
 
29
  $subscription->webhookUrl = 'https://some-webhook-url.com/with/path';
30
  $subscription->description = 'Monthly subscription';
31
  $subscription->update();
32
+
33
  echo "<p>Subscription updated: " . $subscription->id . "</p>";
34
+ } catch (ApiException $e) {
35
+ echo "API call failed: " . htmlspecialchars($e->getMessage());
36
+ }
includes/mollie-api-php/examples/initialize.php CHANGED
@@ -1,14 +1,13 @@
1
  <?php
2
-
3
- namespace _PhpScoper5b6804f9734c8;
4
-
5
  /*
6
  * Make sure to disable the display of errors in production code!
7
  */
8
- \ini_set('display_errors', 1);
9
- \ini_set('display_startup_errors', 1);
10
- \error_reporting(\E_ALL);
 
11
  require_once __DIR__ . "/../vendor/autoload.php";
 
12
  /*
13
  * Initialize the Mollie API library with your API key.
14
  *
1
  <?php
 
 
 
2
  /*
3
  * Make sure to disable the display of errors in production code!
4
  */
5
+ ini_set('display_errors', 1);
6
+ ini_set('display_startup_errors', 1);
7
+ error_reporting(E_ALL);
8
+
9
  require_once __DIR__ . "/../vendor/autoload.php";
10
+
11
  /*
12
  * Initialize the Mollie API library with your API key.
13
  *
includes/mollie-api-php/examples/initialize_with_oauth.php CHANGED
@@ -1,18 +1,18 @@
1
  <?php
2
 
3
- namespace _PhpScoper5b6804f9734c8;
4
-
5
  /*
6
  * Make sure to disable the display of errors in production code!
7
  */
8
- \ini_set('display_errors', 1);
9
- \ini_set('display_startup_errors', 1);
10
- \error_reporting(\E_ALL);
 
11
  require_once __DIR__ . "/../vendor/autoload.php";
 
12
  /*
13
  * Initialize the Mollie API library with OAuth.
14
  *
15
  * See: https://docs.mollie.com/oauth/overview
16
  */
17
  $mollie = new \Mollie\Api\MollieApiClient();
18
- $mollie->setAccessToken("access_Wwvu7egPcJLLJ9Kb7J632x8wJ2zMeJ");
1
  <?php
2
 
 
 
3
  /*
4
  * Make sure to disable the display of errors in production code!
5
  */
6
+ ini_set('display_errors', 1);
7
+ ini_set('display_startup_errors', 1);
8
+ error_reporting(E_ALL);
9
+
10
  require_once __DIR__ . "/../vendor/autoload.php";
11
+
12
  /*
13
  * Initialize the Mollie API library with OAuth.
14
  *
15
  * See: https://docs.mollie.com/oauth/overview
16
  */
17
  $mollie = new \Mollie\Api\MollieApiClient();
18
+ $mollie->setAccessToken("access_Wwvu7egPcJLLJ9Kb7J632x8wJ2zMeJ");
includes/mollie-api-php/examples/orders/.gitignore ADDED
@@ -0,0 +1 @@
 
1
+ *.txt
includes/mollie-api-php/src/CompatibilityChecker.php CHANGED
@@ -3,12 +3,14 @@
3
  namespace Mollie\Api;
4
 
5
  use Mollie\Api\Exceptions\IncompatiblePlatform;
 
6
  class CompatibilityChecker
7
  {
8
  /**
9
  * @var string
10
  */
11
  const MIN_PHP_VERSION = "5.6.0";
 
12
  /**
13
  * @throws IncompatiblePlatform
14
  * @return void
@@ -16,20 +18,29 @@ class CompatibilityChecker
16
  public function checkCompatibility()
17
  {
18
  if (!$this->satisfiesPhpVersion()) {
19
- throw new \Mollie\Api\Exceptions\IncompatiblePlatform("The client requires PHP version >= " . self::MIN_PHP_VERSION . ", you have " . \PHP_VERSION . ".", \Mollie\Api\Exceptions\IncompatiblePlatform::INCOMPATIBLE_PHP_VERSION);
 
 
 
20
  }
 
21
  if (!$this->satisfiesJsonExtension()) {
22
- throw new \Mollie\Api\Exceptions\IncompatiblePlatform("PHP extension json is not enabled. Please make sure to enable 'json' in your PHP configuration.", \Mollie\Api\Exceptions\IncompatiblePlatform::INCOMPATIBLE_JSON_EXTENSION);
 
 
 
23
  }
24
  }
 
25
  /**
26
  * @return bool
27
  * @codeCoverageIgnore
28
  */
29
  public function satisfiesPhpVersion()
30
  {
31
- return (bool) \version_compare(\PHP_VERSION, self::MIN_PHP_VERSION, ">=");
32
  }
 
33
  /**
34
  * @return bool
35
  * @codeCoverageIgnore
@@ -37,11 +48,12 @@ class CompatibilityChecker
37
  public function satisfiesJsonExtension()
38
  {
39
  // Check by extension_loaded
40
- if (\function_exists('extension_loaded') && \extension_loaded('json')) {
41
- return \true;
42
- } elseif (\function_exists('json_encode')) {
43
- return \true;
44
  }
45
- return \false;
 
46
  }
47
  }
3
  namespace Mollie\Api;
4
 
5
  use Mollie\Api\Exceptions\IncompatiblePlatform;
6
+
7
  class CompatibilityChecker
8
  {
9
  /**
10
  * @var string
11
  */
12
  const MIN_PHP_VERSION = "5.6.0";
13
+
14
  /**
15
  * @throws IncompatiblePlatform
16
  * @return void
18
  public function checkCompatibility()
19
  {
20
  if (!$this->satisfiesPhpVersion()) {
21
+ throw new IncompatiblePlatform(
22
+ "The client requires PHP version >= " . self::MIN_PHP_VERSION . ", you have " . PHP_VERSION . ".",
23
+ IncompatiblePlatform::INCOMPATIBLE_PHP_VERSION
24
+ );
25
  }
26
+
27
  if (!$this->satisfiesJsonExtension()) {
28
+ throw new IncompatiblePlatform(
29
+ "PHP extension json is not enabled. Please make sure to enable 'json' in your PHP configuration.",
30
+ IncompatiblePlatform::INCOMPATIBLE_JSON_EXTENSION
31
+ );
32
  }
33
  }
34
+
35
  /**
36
  * @return bool
37
  * @codeCoverageIgnore
38
  */
39
  public function satisfiesPhpVersion()
40
  {
41
+ return (bool)version_compare(PHP_VERSION, self::MIN_PHP_VERSION, ">=");
42
  }
43
+
44
  /**
45
  * @return bool
46
  * @codeCoverageIgnore
48
  public function satisfiesJsonExtension()
49
  {
50
  // Check by extension_loaded
51
+ if (function_exists('extension_loaded') && extension_loaded('json')) {
52
+ return true;
53
+ } elseif (function_exists('json_encode')) {
54
+ return true;
55
  }
56
+
57
+ return false;
58
  }
59
  }
includes/mollie-api-php/src/Endpoints/CustomerEndpoint.php CHANGED
@@ -5,9 +5,11 @@ namespace Mollie\Api\Endpoints;
5
  use Mollie\Api\Exceptions\ApiException;
6
  use Mollie\Api\Resources\Customer;
7
  use Mollie\Api\Resources\CustomerCollection;
8
- class CustomerEndpoint extends \Mollie\Api\Endpoints\EndpointAbstract
 
9
  {
10
  protected $resourcePath = "customers";
 
11
  /**
12
  * Get the object that is used by this API endpoint. Every API endpoint uses one type of object.
13
  *
@@ -15,8 +17,9 @@ class CustomerEndpoint extends \Mollie\Api\Endpoints\EndpointAbstract
15
  */
16
  protected function getResourceObject()
17
  {
18
- return new \Mollie\Api\Resources\Customer($this->api);
19
  }
 
20
  /**
21
  * Get the collection object that is used by this API endpoint. Every API endpoint uses one type of collection object.
22
  *
@@ -27,8 +30,9 @@ class CustomerEndpoint extends \Mollie\Api\Endpoints\EndpointAbstract
27
  */
28
  protected function getResourceCollectionObject($count, $_links)
29
  {
30
- return new \Mollie\Api\Resources\CustomerCollection($this->api, $count, $_links);
31
  }
 
32
  /**
33
  * Creates a customer in Mollie.
34
  *
@@ -42,6 +46,7 @@ class CustomerEndpoint extends \Mollie\Api\Endpoints\EndpointAbstract
42
  {
43
  return $this->rest_create($data, $filters);
44
  }
 
45
  /**
46
  * Retrieve a single customer from Mollie.
47
  *
@@ -56,6 +61,7 @@ class CustomerEndpoint extends \Mollie\Api\Endpoints\EndpointAbstract
56
  {
57
  return $this->rest_read($customerId, $parameters);
58
  }
 
59
  /**
60
  * Deletes the given Customer.
61
  *
@@ -71,6 +77,7 @@ class CustomerEndpoint extends \Mollie\Api\Endpoints\EndpointAbstract
71
  {
72
  return $this->rest_delete($customerId);
73
  }
 
74
  /**
75
  * Retrieves a collection of Customers from Mollie.
76
  *
5
  use Mollie\Api\Exceptions\ApiException;
6
  use Mollie\Api\Resources\Customer;
7
  use Mollie\Api\Resources\CustomerCollection;
8
+
9
+ class CustomerEndpoint extends EndpointAbstract
10
  {
11
  protected $resourcePath = "customers";
12
+
13
  /**
14
  * Get the object that is used by this API endpoint. Every API endpoint uses one type of object.
15
  *
17
  */
18
  protected function getResourceObject()
19
  {
20
+ return new Customer($this->api);
21
  }
22
+
23
  /**
24
  * Get the collection object that is used by this API endpoint. Every API endpoint uses one type of collection object.
25
  *
30
  */
31
  protected function getResourceCollectionObject($count, $_links)
32
  {
33
+ return new CustomerCollection($this->api, $count, $_links);
34
  }
35
+
36
  /**
37
  * Creates a customer in Mollie.
38
  *
46
  {
47
  return $this->rest_create($data, $filters);
48
  }
49
+
50
  /**
51
  * Retrieve a single customer from Mollie.
52
  *
61
  {
62
  return $this->rest_read($customerId, $parameters);
63
  }
64
+
65
  /**
66
  * Deletes the given Customer.
67
  *
77
  {
78
  return $this->rest_delete($customerId);
79
  }
80
+
81
  /**
82
  * Retrieves a collection of Customers from Mollie.
83
  *
includes/mollie-api-php/src/Endpoints/CustomerPaymentsEndpoint.php CHANGED
@@ -6,9 +6,11 @@ use Mollie\Api\Resources\BaseCollection;
6
  use Mollie\Api\Resources\Customer;
7
  use Mollie\Api\Resources\Payment;
8
  use Mollie\Api\Resources\PaymentCollection;
9
- class CustomerPaymentsEndpoint extends \Mollie\Api\Endpoints\EndpointAbstract
 
10
  {
11
  protected $resourcePath = "customers_payments";
 
12
  /**
13
  * Get the object that is used by this API endpoint. Every API endpoint uses one type of object.
14
  *
@@ -16,8 +18,9 @@ class CustomerPaymentsEndpoint extends \Mollie\Api\Endpoints\EndpointAbstract
16
  */
17
  protected function getResourceObject()
18
  {
19
- return new \Mollie\Api\Resources\Payment($this->api);
20
  }
 
21
  /**
22
  * Get the collection object that is used by this API endpoint. Every API endpoint uses one type of collection object.
23
  *
@@ -28,8 +31,9 @@ class CustomerPaymentsEndpoint extends \Mollie\Api\Endpoints\EndpointAbstract
28
  */
29
  protected function getResourceCollectionObject($count, $_links)
30
  {
31
- return new \Mollie\Api\Resources\PaymentCollection($this->api, $count, $_links);
32
  }
 
33
  /**
34
  * Create a subscription for a Customer
35
  *
@@ -39,11 +43,13 @@ class CustomerPaymentsEndpoint extends \Mollie\Api\Endpoints\EndpointAbstract
39
  *
40
  * @return Payment
41
  */
42
- public function createFor(\Mollie\Api\Resources\Customer $customer, array $options = [], array $filters = [])
43
  {
44
  $this->parentId = $customer->id;
 
45
  return parent::rest_create($options, $filters);
46
  }
 
47
  /**
48
  * @param Customer $customer
49
  * @param string $from The first resource ID you want to include in your list.
@@ -52,9 +58,10 @@ class CustomerPaymentsEndpoint extends \Mollie\Api\Endpoints\EndpointAbstract
52
  *
53
  * @return PaymentCollection
54
  */
55
- public function listFor(\Mollie\Api\Resources\Customer $customer, $from = null, $limit = null, array $parameters = [])
56
  {
57
  $this->parentId = $customer->id;
 
58
  return parent::rest_list($from, $limit, $parameters);
59
  }
60
- }
6
  use Mollie\Api\Resources\Customer;
7
  use Mollie\Api\Resources\Payment;
8
  use Mollie\Api\Resources\PaymentCollection;
9
+
10
+ class CustomerPaymentsEndpoint extends EndpointAbstract
11
  {
12
  protected $resourcePath = "customers_payments";
13
+
14
  /**
15
  * Get the object that is used by this API endpoint. Every API endpoint uses one type of object.
16
  *
18
  */
19
  protected function getResourceObject()
20
  {
21
+ return new Payment($this->api);
22
  }
23
+
24
  /**
25
  * Get the collection object that is used by this API endpoint. Every API endpoint uses one type of collection object.
26
  *
31
  */
32
  protected function getResourceCollectionObject($count, $_links)
33
  {
34
+ return new PaymentCollection($this->api, $count, $_links);
35
  }
36
+
37
  /**
38
  * Create a subscription for a Customer
39
  *
43
  *
44
  * @return Payment
45
  */
46
+ public function createFor(Customer $customer, array $options = [], array $filters = [])
47
  {
48
  $this->parentId = $customer->id;
49
+
50
  return parent::rest_create($options, $filters);
51
  }
52
+
53
  /**
54
  * @param Customer $customer
55
  * @param string $from The first resource ID you want to include in your list.
58
  *
59
  * @return PaymentCollection
60
  */
61
+ public function listFor(Customer $customer, $from = null, $limit = null, array $parameters = [])
62
  {
63
  $this->parentId = $customer->id;
64
+
65
  return parent::rest_list($from, $limit, $parameters);
66
  }
67
+ }
includes/mollie-api-php/src/Endpoints/EndpointAbstract.php CHANGED
@@ -7,33 +7,39 @@ use Mollie\Api\MollieApiClient;
7
  use Mollie\Api\Resources\BaseCollection;
8
  use Mollie\Api\Resources\BaseResource;
9
  use Mollie\Api\Resources\ResourceFactory;
10
- use _PhpScoper5b6804f9734c8\Psr\Http\Message\StreamInterface;
 
11
  abstract class EndpointAbstract
12
  {
13
- const REST_CREATE = \Mollie\Api\MollieApiClient::HTTP_POST;
14
- const REST_UPDATE = \Mollie\Api\MollieApiClient::HTTP_PATCH;
15
- const REST_READ = \Mollie\Api\MollieApiClient::HTTP_GET;
16
- const REST_LIST = \Mollie\Api\MollieApiClient::HTTP_GET;
17
- const REST_DELETE = \Mollie\Api\MollieApiClient::HTTP_DELETE;
 
18
  /**
19
  * @var MollieApiClient
20
  */
21
  protected $api;
 
22
  /**
23
  * @var string
24
  */
25
  protected $resourcePath;
 
26
  /**
27
  * @var string|null
28
  */
29
  protected $parentId;
 
30
  /**
31
  * @param MollieApiClient $api
32
  */
33
- public function __construct(\Mollie\Api\MollieApiClient $api)
34
  {
35
  $this->api = $api;
36
  }
 
37
  /**
38
  * @param array $filters
39
  * @return string
@@ -43,16 +49,20 @@ abstract class EndpointAbstract
43
  if (empty($filters)) {
44
  return "";
45
  }
 
46
  foreach ($filters as $key => $value) {
47
- if ($value === \true) {
48
  $filters[$key] = "true";
49
  }
50
- if ($value === \false) {
 
51
  $filters[$key] = "false";
52
  }
53
  }
54
- return "?" . \http_build_query($filters, "", "&");
 
55
  }
 
56
  /**
57
  * @param array $body
58
  * @param array $filters
@@ -61,9 +71,15 @@ abstract class EndpointAbstract
61
  */
62
  protected function rest_create(array $body, array $filters)
63
  {
64
- $result = $this->api->performHttpCall(self::REST_CREATE, $this->getResourcePath() . $this->buildQueryString($filters), $this->parseRequestBody($body));
65
- return \Mollie\Api\Resources\ResourceFactory::createFromApiResult($result, $this->getResourceObject());
 
 
 
 
 
66
  }
 
67
  /**
68
  * Retrieves a single object from the REST API.
69
  *
@@ -75,12 +91,18 @@ abstract class EndpointAbstract
75
  protected function rest_read($id, array $filters)
76
  {
77
  if (empty($id)) {
78
- throw new \Mollie\Api\Exceptions\ApiException("Invalid resource id.");
79
  }
80
- $id = \urlencode($id);
81
- $result = $this->api->performHttpCall(self::REST_READ, "{$this->getResourcePath()}/{$id}" . $this->buildQueryString($filters));
82
- return \Mollie\Api\Resources\ResourceFactory::createFromApiResult($result, $this->getResourceObject());
 
 
 
 
 
83
  }
 
84
  /**
85
  * Sends a DELETE request to a single Molle API object.
86
  *
@@ -92,15 +114,22 @@ abstract class EndpointAbstract
92
  protected function rest_delete($id)
93
  {
94
  if (empty($id)) {
95
- throw new \Mollie\Api\Exceptions\ApiException("Invalid resource id.");
96
  }
97
- $id = \urlencode($id);
98
- $result = $this->api->performHttpCall(self::REST_DELETE, "{$this->getResourcePath()}/{$id}");
 
 
 
 
 
99
  if ($result === null) {
100
  return null;
101
  }
102
- return \Mollie\Api\Resources\ResourceFactory::createFromApiResult($result, $this->getResourceObject());
 
103
  }
 
104
  /**
105
  * Get a collection of objects from the REST API.
106
  *
@@ -113,22 +142,29 @@ abstract class EndpointAbstract
113
  */
114
  protected function rest_list($from = null, $limit = null, array $filters)
115
  {
116
- $filters = \array_merge(["from" => $from, "limit" => $limit], $filters);
 
117
  $apiPath = $this->getResourcePath() . $this->buildQueryString($filters);
 
118
  $result = $this->api->performHttpCall(self::REST_LIST, $apiPath);
 
119
  /** @var BaseCollection $collection */
120
  $collection = $this->getResourceCollectionObject($result->count, $result->_links);
 
121
  foreach ($result->_embedded->{$collection->getCollectionResourceName()} as $dataResult) {
122
- $collection[] = \Mollie\Api\Resources\ResourceFactory::createFromApiResult($dataResult, $this->getResourceObject());
123
  }
 
124
  return $collection;
125
  }
 
126
  /**
127
  * Get the object that is used by this API endpoint. Every API endpoint uses one type of object.
128
  *
129
  * @return BaseResource
130
  */
131
- protected abstract function getResourceObject();
 
132
  /**
133
  * Get the collection object that is used by this API endpoint. Every API endpoint uses one type of collection object.
134
  *
@@ -137,29 +173,35 @@ abstract class EndpointAbstract
137
  *
138
  * @return BaseCollection
139
  */
140
- protected abstract function getResourceCollectionObject($count, $_links);
 
141
  /**
142
  * @param string $resourcePath
143
  */
144
  public function setResourcePath($resourcePath)
145
  {
146
- $this->resourcePath = \strtolower($resourcePath);
147
  }
 
148
  /**
149
  * @return string
150
  * @throws ApiException
151
  */
152
  public function getResourcePath()
153
  {
154
- if (\strpos($this->resourcePath, "_") !== \false) {
155
- list($parentResource, $childResource) = \explode("_", $this->resourcePath, 2);
 
156
  if (empty($this->parentId)) {
157
- throw new \Mollie\Api\Exceptions\ApiException("Subresource '{$this->resourcePath}' used without parent '{$parentResource}' ID.");
158
  }
159
- return "{$parentResource}/{$this->parentId}/{$childResource}";
 
160
  }
 
161
  return $this->resourcePath;
162
  }
 
163
  /**
164
  * @param array $body
165
  * @return null|string
@@ -170,11 +212,13 @@ abstract class EndpointAbstract
170
  if (empty($body)) {
171
  return null;
172
  }
 
173
  try {
174
- $encoded = \_PhpScoper5b6804f9734c8\GuzzleHttp\json_encode($body);
175
  } catch (\InvalidArgumentException $e) {
176
- throw new \Mollie\Api\Exceptions\ApiException("Error encoding parameters into JSON: '" . $e->getMessage() . "'.");
177
  }
 
178
  return $encoded;
179
  }
180
  }
7
  use Mollie\Api\Resources\BaseCollection;
8
  use Mollie\Api\Resources\BaseResource;
9
  use Mollie\Api\Resources\ResourceFactory;
10
+ use Psr\Http\Message\StreamInterface;
11
+
12
  abstract class EndpointAbstract
13
  {
14
+ const REST_CREATE = MollieApiClient::HTTP_POST;
15
+ const REST_UPDATE = MollieApiClient::HTTP_PATCH;
16
+ const REST_READ = MollieApiClient::HTTP_GET;
17
+ const REST_LIST = MollieApiClient::HTTP_GET;
18
+ const REST_DELETE = MollieApiClient::HTTP_DELETE;
19
+
20
  /**
21
  * @var MollieApiClient
22
  */
23
  protected $api;
24
+
25
  /**
26
  * @var string
27
  */
28
  protected $resourcePath;
29
+
30
  /**
31
  * @var string|null
32
  */
33
  protected $parentId;
34
+
35
  /**
36
  * @param MollieApiClient $api
37
  */
38
+ public function __construct(MollieApiClient $api)
39
  {
40
  $this->api = $api;
41
  }
42
+
43
  /**
44
  * @param array $filters
45
  * @return string
49
  if (empty($filters)) {
50
  return "";
51
  }
52
+
53
  foreach ($filters as $key => $value) {
54
+ if ($value === true) {
55
  $filters[$key] = "true";
56
  }
57
+
58
+ if ($value === false) {
59
  $filters[$key] = "false";
60
  }
61
  }
62
+
63
+ return "?" . http_build_query($filters, "", "&");
64
  }
65
+
66
  /**
67
  * @param array $body
68
  * @param array $filters
71
  */
72
  protected function rest_create(array $body, array $filters)
73
  {
74
+ $result = $this->api->performHttpCall(
75
+ self::REST_CREATE,
76
+ $this->getResourcePath() . $this->buildQueryString($filters),
77
+ $this->parseRequestBody($body)
78
+ );
79
+
80
+ return ResourceFactory::createFromApiResult($result, $this->getResourceObject());
81
  }
82
+
83
  /**
84
  * Retrieves a single object from the REST API.
85
  *
91
  protected function rest_read($id, array $filters)
92
  {
93
  if (empty($id)) {
94
+ throw new ApiException("Invalid resource id.");
95
  }
96
+
97
+ $id = urlencode($id);
98
+ $result = $this->api->performHttpCall(
99
+ self::REST_READ,
100
+ "{$this->getResourcePath()}/{$id}" . $this->buildQueryString($filters)
101
+ );
102
+
103
+ return ResourceFactory::createFromApiResult($result, $this->getResourceObject());
104
  }
105
+
106
  /**
107
  * Sends a DELETE request to a single Molle API object.
108
  *
114
  protected function rest_delete($id)
115
  {
116
  if (empty($id)) {
117
+ throw new ApiException("Invalid resource id.");
118
  }
119
+
120
+ $id = urlencode($id);
121
+ $result = $this->api->performHttpCall(
122
+ self::REST_DELETE,
123
+ "{$this->getResourcePath()}/{$id}"
124
+ );
125
+
126
  if ($result === null) {
127
  return null;
128
  }
129
+
130
+ return ResourceFactory::createFromApiResult($result, $this->getResourceObject());
131
  }
132
+
133
  /**
134
  * Get a collection of objects from the REST API.
135
  *
142
  */
143
  protected function rest_list($from = null, $limit = null, array $filters)
144
  {
145
+ $filters = array_merge(["from" => $from, "limit" => $limit], $filters);
146
+
147
  $apiPath = $this->getResourcePath() . $this->buildQueryString($filters);
148
+
149
  $result = $this->api->performHttpCall(self::REST_LIST, $apiPath);
150
+
151
  /** @var BaseCollection $collection */
152
  $collection = $this->getResourceCollectionObject($result->count, $result->_links);
153
+
154
  foreach ($result->_embedded->{$collection->getCollectionResourceName()} as $dataResult) {
155
+ $collection[] = ResourceFactory::createFromApiResult($dataResult, $this->getResourceObject());
156
  }
157
+
158
  return $collection;
159
  }
160
+
161
  /**
162
  * Get the object that is used by this API endpoint. Every API endpoint uses one type of object.
163
  *
164
  * @return BaseResource
165
  */
166
+ abstract protected function getResourceObject();
167
+
168
  /**
169
  * Get the collection object that is used by this API endpoint. Every API endpoint uses one type of collection object.
170
  *
173
  *
174
  * @return BaseCollection
175
  */
176
+ abstract protected function getResourceCollectionObject($count, $_links);
177
+
178
  /**
179
  * @param string $resourcePath
180
  */
181
  public function setResourcePath($resourcePath)
182
  {
183
+ $this->resourcePath = strtolower($resourcePath);
184
  }
185
+
186
  /**
187
  * @return string
188
  * @throws ApiException
189
  */
190
  public function getResourcePath()
191
  {
192
+ if (strpos($this->resourcePath, "_") !== false) {
193
+ list($parentResource, $childResource) = explode("_", $this->resourcePath, 2);
194
+
195
  if (empty($this->parentId)) {
196
+ throw new ApiException("Subresource '{$this->resourcePath}' used without parent '$parentResource' ID.");
197
  }
198
+
199
+ return "$parentResource/{$this->parentId}/$childResource";
200
  }
201
+
202
  return $this->resourcePath;
203
  }
204
+
205
  /**
206
  * @param array $body
207
  * @return null|string
212
  if (empty($body)) {
213
  return null;
214
  }
215
+
216
  try {
217
+ $encoded = \GuzzleHttp\json_encode($body);
218
  } catch (\InvalidArgumentException $e) {
219
+ throw new ApiException("Error encoding parameters into JSON: '" . $e->getMessage() . "'.");
220
  }
221
+
222
  return $encoded;
223
  }
224
  }
includes/mollie-api-php/src/Endpoints/InvoiceEndpoint.php CHANGED
@@ -5,9 +5,11 @@ namespace Mollie\Api\Endpoints;
5
  use Mollie\Api\Exceptions\ApiException;
6
  use Mollie\Api\Resources\Invoice;
7
  use Mollie\Api\Resources\InvoiceCollection;
8
- class InvoiceEndpoint extends \Mollie\Api\Endpoints\EndpointAbstract
 
9
  {
10
  protected $resourcePath = "invoices";
 
11
  /**
12
  * Get the object that is used by this API. Every API uses one type of object.
13
  *
@@ -15,8 +17,9 @@ class InvoiceEndpoint extends \Mollie\Api\Endpoints\EndpointAbstract
15
  */
16
  protected function getResourceObject()
17
  {
18
- return new \Mollie\Api\Resources\Invoice($this->api);
19
  }
 
20
  /**
21
  * Get the collection object that is used by this API. Every API uses one type of collection object.
22
  *
@@ -27,8 +30,9 @@ class InvoiceEndpoint extends \Mollie\Api\Endpoints\EndpointAbstract
27
  */
28
  protected function getResourceCollectionObject($count, $_links)
29
  {
30
- return new \Mollie\Api\Resources\InvoiceCollection($this->api, $count, $_links);
31
  }
 
32
  /**
33
  * Retrieve an Invoice from Mollie.
34
  *
@@ -44,6 +48,7 @@ class InvoiceEndpoint extends \Mollie\Api\Endpoints\EndpointAbstract
44
  {
45
  return $this->rest_read($invoiceId, $parameters);
46
  }
 
47
  /**
48
  * Retrieves a collection of Invoices from Mollie.
49
  *
@@ -58,6 +63,7 @@ class InvoiceEndpoint extends \Mollie\Api\Endpoints\EndpointAbstract
58
  {
59
  return $this->rest_list($from, $limit, $parameters);
60
  }
 
61
  /**
62
  * This is a wrapper method for page
63
  *
@@ -67,6 +73,6 @@ class InvoiceEndpoint extends \Mollie\Api\Endpoints\EndpointAbstract
67
  */
68
  public function all(array $parameters = [])
69
  {
70
- return $this->page(null, null, $parameters);
71
  }
72
- }
5
  use Mollie\Api\Exceptions\ApiException;
6
  use Mollie\Api\Resources\Invoice;
7
  use Mollie\Api\Resources\InvoiceCollection;
8
+
9
+ class InvoiceEndpoint extends EndpointAbstract
10
  {
11
  protected $resourcePath = "invoices";
12
+
13
  /**
14
  * Get the object that is used by this API. Every API uses one type of object.
15
  *
17
  */
18
  protected function getResourceObject()
19
  {
20
+ return new Invoice($this->api);
21
  }
22
+
23
  /**
24
  * Get the collection object that is used by this API. Every API uses one type of collection object.
25
  *
30
  */
31
  protected function getResourceCollectionObject($count, $_links)
32
  {
33
+ return new InvoiceCollection($this->api, $count, $_links);
34
  }
35
+
36
  /**
37
  * Retrieve an Invoice from Mollie.
38
  *
48
  {
49
  return $this->rest_read($invoiceId, $parameters);
50
  }
51
+
52
  /**
53
  * Retrieves a collection of Invoices from Mollie.
54
  *
63
  {
64
  return $this->rest_list($from, $limit, $parameters);
65
  }
66
+
67
  /**
68
  * This is a wrapper method for page
69
  *
73
  */
74
  public function all(array $parameters = [])
75
  {
76
+ return $this->page( null, null, $parameters);
77
  }
78
+ }
includes/mollie-api-php/src/Endpoints/MandateEndpoint.php CHANGED
@@ -6,9 +6,11 @@ use Mollie\Api\Resources\BaseCollection;
6
  use Mollie\Api\Resources\Customer;
7
  use Mollie\Api\Resources\Mandate;
8
  use Mollie\Api\Resources\MandateCollection;
9
- class MandateEndpoint extends \Mollie\Api\Endpoints\EndpointAbstract
 
10
  {
11
  protected $resourcePath = "customers_mandates";
 
12
  /**
13
  * Get the object that is used by this API endpoint. Every API endpoint uses one type of object.
14
  *
@@ -16,8 +18,9 @@ class MandateEndpoint extends \Mollie\Api\Endpoints\EndpointAbstract
16
  */
17
  protected function getResourceObject()
18
  {
19
- return new \Mollie\Api\Resources\Mandate($this->api);
20
  }
 
21
  /**
22
  * Get the collection object that is used by this API endpoint. Every API endpoint uses one type of collection object.
23
  *
@@ -28,8 +31,9 @@ class MandateEndpoint extends \Mollie\Api\Endpoints\EndpointAbstract
28
  */
29
  protected function getResourceCollectionObject($count, $_links)
30
  {
31
- return new \Mollie\Api\Resources\MandateCollection($this->api, $count, $_links);
32
  }
 
33
  /**
34
  * @param Customer $customer
35
  * @param array $options
@@ -37,11 +41,13 @@ class MandateEndpoint extends \Mollie\Api\Endpoints\EndpointAbstract
37
  *
38
  * @return Mandate
39
  */
40
- public function createFor(\Mollie\Api\Resources\Customer $customer, array $options = [], array $filters = [])
41
  {
42
  $this->parentId = $customer->id;
 
43
  return parent::rest_create($options, $filters);
44
  }
 
45
  /**
46
  * @param Customer $customer
47
  * @param string $mandateId
@@ -49,11 +55,13 @@ class MandateEndpoint extends \Mollie\Api\Endpoints\EndpointAbstract
49
  *
50
  * @return Mandate
51
  */
52
- public function getFor(\Mollie\Api\Resources\Customer $customer, $mandateId, array $parameters = [])
53
  {
54
  $this->parentId = $customer->id;
 
55
  return parent::rest_read($mandateId, $parameters);
56
  }
 
57
  /**
58
  * @param Customer $customer
59
  * @param string $from The first resource ID you want to include in your list.
@@ -62,20 +70,23 @@ class MandateEndpoint extends \Mollie\Api\Endpoints\EndpointAbstract
62
  *
63
  * @return MandateCollection
64
  */
65
- public function listFor(\Mollie\Api\Resources\Customer $customer, $from = null, $limit = null, array $parameters = [])
66
  {
67
  $this->parentId = $customer->id;
 
68
  return parent::rest_list($from, $limit, $parameters);
69
  }
 
70
  /**
71
  * @param Customer $customer
72
  * @param string $mandateId
73
  *
74
  * @return null
75
  */
76
- public function revokeFor(\Mollie\Api\Resources\Customer $customer, $mandateId)
77
  {
78
  $this->parentId = $customer->id;
 
79
  return parent::rest_delete($mandateId);
80
  }
81
- }
6
  use Mollie\Api\Resources\Customer;
7
  use Mollie\Api\Resources\Mandate;
8
  use Mollie\Api\Resources\MandateCollection;
9
+
10
+ class MandateEndpoint extends EndpointAbstract
11
  {
12
  protected $resourcePath = "customers_mandates";
13
+
14
  /**
15
  * Get the object that is used by this API endpoint. Every API endpoint uses one type of object.
16
  *
18
  */
19
  protected function getResourceObject()
20
  {
21
+ return new Mandate($this->api);
22
  }
23
+
24
  /**
25
  * Get the collection object that is used by this API endpoint. Every API endpoint uses one type of collection object.
26
  *
31
  */
32
  protected function getResourceCollectionObject($count, $_links)
33
  {
34
+ return new MandateCollection($this->api, $count, $_links);
35
  }
36
+
37
  /**
38
  * @param Customer $customer
39
  * @param array $options
41
  *
42
  * @return Mandate
43
  */
44
+ public function createFor(Customer $customer, array $options = [], array $filters = [])
45
  {
46
  $this->parentId = $customer->id;
47
+
48
  return parent::rest_create($options, $filters);
49
  }
50
+
51
  /**
52
  * @param Customer $customer
53
  * @param string $mandateId
55
  *
56
  * @return Mandate
57
  */
58
+ public function getFor(Customer $customer, $mandateId, array $parameters = [])
59
  {
60
  $this->parentId = $customer->id;
61
+
62
  return parent::rest_read($mandateId, $parameters);
63
  }
64
+
65
  /**
66
  * @param Customer $customer
67
  * @param string $from The first resource ID you want to include in your list.
70
  *
71
  * @return MandateCollection
72
  */
73
+ public function listFor(Customer $customer, $from = null, $limit = null, array $parameters = [])
74
  {
75
  $this->parentId = $customer->id;
76
+
77
  return parent::rest_list($from, $limit, $parameters);
78
  }
79
+
80
  /**
81
  * @param Customer $customer
82
  * @param string $mandateId
83
  *
84
  * @return null
85
  */
86
+ public function revokeFor(Customer $customer, $mandateId)
87
  {
88
  $this->parentId = $customer->id;
89
+
90
  return parent::rest_delete($mandateId);
91
  }
92
+ }
includes/mollie-api-php/src/Endpoints/MethodEndpoint.php CHANGED
@@ -5,16 +5,19 @@ namespace Mollie\Api\Endpoints;
5
  use Mollie\Api\Exceptions\ApiException;
6
  use Mollie\Api\Resources\Method;
7
  use Mollie\Api\Resources\MethodCollection;
8
- class MethodEndpoint extends \Mollie\Api\Endpoints\EndpointAbstract
 
9
  {
10
  protected $resourcePath = "methods";
 
11
  /**
12
  * @return Method
13
  */
14
  protected function getResourceObject()
15
  {
16
- return new \Mollie\Api\Resources\Method($this->api);
17
  }
 
18
  /**
19
  * Get the collection object that is used by this API endpoint. Every API endpoint uses one type of collection object.
20
  *
@@ -25,8 +28,9 @@ class MethodEndpoint extends \Mollie\Api\Endpoints\EndpointAbstract
25
  */
26
  protected function getResourceCollectionObject($count, $_links)
27
  {
28
- return new \Mollie\Api\Resources\MethodCollection($count, $_links);
29
  }
 
30
  /**
31
  * Retrieve a payment method from Mollie.
32
  *
@@ -40,10 +44,12 @@ class MethodEndpoint extends \Mollie\Api\Endpoints\EndpointAbstract
40
  public function get($methodId, array $parameters = [])
41
  {
42
  if (empty($methodId)) {
43
- throw new \Mollie\Api\Exceptions\ApiException("Method ID is empty.");
44
  }
 
45
  return parent::rest_read($methodId, $parameters);
46
  }
 
47
  /**
48
  * Retrieve all methods.
49
  *
5
  use Mollie\Api\Exceptions\ApiException;
6
  use Mollie\Api\Resources\Method;
7
  use Mollie\Api\Resources\MethodCollection;
8
+
9
+ class MethodEndpoint extends EndpointAbstract
10
  {
11
  protected $resourcePath = "methods";
12
+
13
  /**
14
  * @return Method
15
  */
16
  protected function getResourceObject()
17
  {
18
+ return new Method($this->api);
19
  }
20
+
21
  /**
22
  * Get the collection object that is used by this API endpoint. Every API endpoint uses one type of collection object.
23
  *
28
  */
29
  protected function getResourceCollectionObject($count, $_links)
30
  {
31
+ return new MethodCollection($count, $_links);
32
  }
33
+
34
  /**
35
  * Retrieve a payment method from Mollie.
36
  *
44
  public function get($methodId, array $parameters = [])
45
  {
46
  if (empty($methodId)) {
47
+ throw new ApiException("Method ID is empty.");
48
  }
49
+
50
  return parent::rest_read($methodId, $parameters);
51
  }
52
+
53
  /**
54
  * Retrieve all methods.
55
  *
includes/mollie-api-php/src/Endpoints/PaymentEndpoint.php CHANGED
@@ -7,20 +7,24 @@ use Mollie\Api\Resources\Payment;
7
  use Mollie\Api\Resources\PaymentCollection;
8
  use Mollie\Api\Resources\Refund;
9
  use Mollie\Api\Resources\ResourceFactory;
10
- class PaymentEndpoint extends \Mollie\Api\Endpoints\EndpointAbstract
 
11
  {
12
  protected $resourcePath = "payments";
 
13
  /**
14
  * @var string
15
  */
16
  const RESOURCE_ID_PREFIX = 'tr_';
 
17
  /**
18
  * @return Payment
19
  */
20
  protected function getResourceObject()
21
  {
22
- return new \Mollie\Api\Resources\Payment($this->api);
23
  }
 
24
  /**
25
  * Get the collection object that is used by this API endpoint. Every API endpoint uses one type of collection object.
26
  *
@@ -31,8 +35,9 @@ class PaymentEndpoint extends \Mollie\Api\Endpoints\EndpointAbstract
31
  */
32
  protected function getResourceCollectionObject($count, $_links)
33
  {
34
- return new \Mollie\Api\Resources\PaymentCollection($this->api, $count, $_links);
35
  }
 
36
  /**
37
  * Creates a payment in Mollie.
38
  *
@@ -46,6 +51,7 @@ class PaymentEndpoint extends \Mollie\Api\Endpoints\EndpointAbstract
46
  {
47
  return $this->rest_create($data, $filters);
48
  }
 
49
  /**
50
  * Retrieve a single payment from Mollie.
51
  *
@@ -58,11 +64,13 @@ class PaymentEndpoint extends \Mollie\Api\Endpoints\EndpointAbstract
58
  */
59
  public function get($paymentId, array $parameters = [])
60
  {
61
- if (empty($paymentId) || \strpos($paymentId, self::RESOURCE_ID_PREFIX) !== 0) {
62
- throw new \Mollie\Api\Exceptions\ApiException("Invalid payment ID: '{$paymentId}'. A payment ID should start with '" . self::RESOURCE_ID_PREFIX . "'.");
63
  }
 
64
  return parent::rest_read($paymentId, $parameters);
65
  }
 
66
  /**
67
  * Deletes the given Payment.
68
  *
@@ -78,6 +86,7 @@ class PaymentEndpoint extends \Mollie\Api\Endpoints\EndpointAbstract
78
  {
79
  return $this->rest_delete($paymentId);
80
  }
 
81
  /**
82
  * Cancel the given Payment. This is just an alias of the 'delete' method.
83
  *
@@ -93,6 +102,7 @@ class PaymentEndpoint extends \Mollie\Api\Endpoints\EndpointAbstract
93
  {
94
  return $this->rest_delete($paymentId);
95
  }
 
96
  /**
97
  * Retrieves a collection of Payments from Mollie.
98
  *
@@ -107,6 +117,7 @@ class PaymentEndpoint extends \Mollie\Api\Endpoints\EndpointAbstract
107
  {
108
  return $this->rest_list($from, $limit, $parameters);
109
  }
 
110
  /**
111
  * Issue a refund for the given payment.
112
  *
@@ -119,14 +130,17 @@ class PaymentEndpoint extends \Mollie\Api\Endpoints\EndpointAbstract
119
  * @return Refund
120
  * @throws ApiException
121
  */
122
- public function refund(\Mollie\Api\Resources\Payment $payment, $data = [])
123
  {
124
- $resource = "{$this->getResourcePath()}/" . \urlencode($payment->id) . "/refunds";
 
125
  $body = null;
126
- if (\count($data) > 0) {
127
- $body = \json_encode($data);
128
  }
 
129
  $result = $this->api->performHttpCall(self::REST_CREATE, $resource, $body);
130
- return \Mollie\Api\Resources\ResourceFactory::createFromApiResult($result, new \Mollie\Api\Resources\Refund($this->api));
 
131
  }
132
  }
7
  use Mollie\Api\Resources\PaymentCollection;
8
  use Mollie\Api\Resources\Refund;
9
  use Mollie\Api\Resources\ResourceFactory;
10
+
11
+ class PaymentEndpoint extends EndpointAbstract
12
  {
13
  protected $resourcePath = "payments";
14
+
15
  /**
16
  * @var string
17
  */
18
  const RESOURCE_ID_PREFIX = 'tr_';
19
+
20
  /**
21
  * @return Payment
22
  */
23
  protected function getResourceObject()
24
  {
25
+ return new Payment($this->api);
26
  }
27
+
28
  /**
29
  * Get the collection object that is used by this API endpoint. Every API endpoint uses one type of collection object.
30
  *
35
  */
36
  protected function getResourceCollectionObject($count, $_links)
37
  {
38
+ return new PaymentCollection($this->api, $count, $_links);
39
  }
40
+
41
  /**
42
  * Creates a payment in Mollie.
43
  *
51
  {
52
  return $this->rest_create($data, $filters);
53
  }
54
+
55
  /**
56
  * Retrieve a single payment from Mollie.
57
  *
64
  */
65
  public function get($paymentId, array $parameters = [])
66
  {
67
+ if (empty($paymentId) || strpos($paymentId, self::RESOURCE_ID_PREFIX) !== 0) {
68
+ throw new ApiException("Invalid payment ID: '{$paymentId}'. A payment ID should start with '" . self::RESOURCE_ID_PREFIX . "'.");
69
  }
70
+
71
  return parent::rest_read($paymentId, $parameters);
72
  }
73
+
74
  /**
75
  * Deletes the given Payment.
76
  *
86
  {
87
  return $this->rest_delete($paymentId);
88
  }
89
+
90
  /**
91
  * Cancel the given Payment. This is just an alias of the 'delete' method.
92
  *
102
  {
103
  return $this->rest_delete($paymentId);
104
  }
105
+
106
  /**
107
  * Retrieves a collection of Payments from Mollie.
108
  *
117
  {
118
  return $this->rest_list($from, $limit, $parameters);
119
  }
120
+
121
  /**
122
  * Issue a refund for the given payment.
123
  *
130
  * @return Refund
131
  * @throws ApiException
132
  */
133
+ public function refund(Payment $payment, $data = [])
134
  {
135
+ $resource = "{$this->getResourcePath()}/" . urlencode($payment->id) . "/refunds";
136
+
137
  $body = null;
138
+ if (count($data) > 0) {
139
+ $body = json_encode($data);
140
  }
141
+
142
  $result = $this->api->performHttpCall(self::REST_CREATE, $resource, $body);
143
+
144
+ return ResourceFactory::createFromApiResult($result, new Refund($this->api));
145
  }
146
  }
includes/mollie-api-php/src/Endpoints/PaymentRefundEndpoint.php CHANGED
@@ -5,9 +5,11 @@ namespace Mollie\Api\Endpoints;
5
  use Mollie\Api\Resources\Payment;
6
  use Mollie\Api\Resources\Refund;
7
  use Mollie\Api\Resources\RefundCollection;
8
- class PaymentRefundEndpoint extends \Mollie\Api\Endpoints\EndpointAbstract
 
9
  {
10
  protected $resourcePath = "payments_refunds";
 
11
  /**
12
  * Get the object that is used by this API endpoint. Every API endpoint uses one type of object.
13
  *
@@ -15,8 +17,9 @@ class PaymentRefundEndpoint extends \Mollie\Api\Endpoints\EndpointAbstract
15
  */
16
  protected function getResourceObject()
17
  {
18
- return new \Mollie\Api\Resources\Refund($this->api);
19
  }
 
20
  /**
21
  * Get the collection object that is used by this API endpoint. Every API endpoint uses one type of collection object.
22
  *
@@ -27,8 +30,9 @@ class PaymentRefundEndpoint extends \Mollie\Api\Endpoints\EndpointAbstract
27
  */
28
  protected function getResourceCollectionObject($count, $_links)
29
  {
30
- return new \Mollie\Api\Resources\RefundCollection($this->api, $count, $_links);
31
  }
 
32
  /**
33
  * @param Payment $payment
34
  * @param string $refundId
@@ -36,9 +40,10 @@ class PaymentRefundEndpoint extends \Mollie\Api\Endpoints\EndpointAbstract
36
  *
37
  * @return Refund
38
  */
39
- public function getFor(\Mollie\Api\Resources\Payment $payment, $refundId, array $parameters = [])
40
  {
41
  $this->parentId = $payment->id;
 
42
  return parent::rest_read($refundId, $parameters);
43
  }
44
  }
5
  use Mollie\Api\Resources\Payment;
6
  use Mollie\Api\Resources\Refund;
7
  use Mollie\Api\Resources\RefundCollection;
8
+
9
+ class PaymentRefundEndpoint extends EndpointAbstract
10
  {
11
  protected $resourcePath = "payments_refunds";
12
+
13
  /**
14
  * Get the object that is used by this API endpoint. Every API endpoint uses one type of object.
15
  *
17
  */
18
  protected function getResourceObject()
19
  {
20
+ return new Refund($this->api);
21
  }
22
+
23
  /**
24
  * Get the collection object that is used by this API endpoint. Every API endpoint uses one type of collection object.
25
  *
30
  */
31
  protected function getResourceCollectionObject($count, $_links)
32
  {
33
+ return new RefundCollection($this->api, $count, $_links);
34
  }
35
+
36
  /**
37
  * @param Payment $payment
38
  * @param string $refundId
40
  *
41
  * @return Refund
42
  */
43
+ public function getFor(Payment $payment, $refundId, array $parameters = [])
44
  {
45
  $this->parentId = $payment->id;
46
+
47
  return parent::rest_read($refundId, $parameters);
48
  }
49
  }
includes/mollie-api-php/src/Endpoints/ProfileEndpoint.php CHANGED
@@ -5,9 +5,11 @@ namespace Mollie\Api\Endpoints;
5
  use Mollie\Api\Exceptions\ApiException;
6
  use Mollie\Api\Resources\Profile;
7
  use Mollie\Api\Resources\ProfileCollection;
8
- class ProfileEndpoint extends \Mollie\Api\Endpoints\EndpointAbstract
 
9
  {
10
  protected $resourcePath = "profiles";
 
11
  /**
12
  * Get the object that is used by this API endpoint. Every API endpoint uses one type of object.
13
  *
@@ -15,8 +17,9 @@ class ProfileEndpoint extends \Mollie\Api\Endpoints\EndpointAbstract
15
  */
16
  protected function getResourceObject()
17
  {
18
- return new \Mollie\Api\Resources\Profile($this->api);
19
  }
 
20
  /**
21
  * Get the collection object that is used by this API endpoint. Every API endpoint uses one type of collection object.
22
  *
@@ -27,8 +30,9 @@ class ProfileEndpoint extends \Mollie\Api\Endpoints\EndpointAbstract
27
  */
28
  protected function getResourceCollectionObject($count, $_links)
29
  {
30
- return new \Mollie\Api\Resources\ProfileCollection($this->api, $count, $_links);
31
  }
 
32
  /**
33
  * Creates a Profile in Mollie.
34
  *
@@ -40,8 +44,9 @@ class ProfileEndpoint extends \Mollie\Api\Endpoints\EndpointAbstract
40
  */
41
  public function create(array $data = [], array $filters = [])
42
  {
43
- return $this->rest_create($data, $filters);
44
  }
 
45
  /**
46
  * Retrieve a Profile from Mollie.
47
  *
@@ -57,6 +62,7 @@ class ProfileEndpoint extends \Mollie\Api\Endpoints\EndpointAbstract
57
  {
58
  return $this->rest_read($profileId, $parameters);
59
  }
 
60
  /**
61
  * Delete a Profile from Mollie.
62
  *
@@ -72,6 +78,7 @@ class ProfileEndpoint extends \Mollie\Api\Endpoints\EndpointAbstract
72
  {
73
  return $this->rest_delete($profileId);
74
  }
 
75
  /**
76
  * Retrieves a collection of Profiles from Mollie.
77
  *
@@ -86,4 +93,6 @@ class ProfileEndpoint extends \Mollie\Api\Endpoints\EndpointAbstract
86
  {
87
  return $this->rest_list($from, $limit, $parameters);
88
  }
89
- }
 
 
5
  use Mollie\Api\Exceptions\ApiException;
6
  use Mollie\Api\Resources\Profile;
7
  use Mollie\Api\Resources\ProfileCollection;
8
+
9
+ class ProfileEndpoint extends EndpointAbstract
10
  {
11
  protected $resourcePath = "profiles";
12
+
13
  /**
14
  * Get the object that is used by this API endpoint. Every API endpoint uses one type of object.
15
  *
17
  */
18
  protected function getResourceObject()
19
  {
20
+ return new Profile($this->api);
21
  }
22
+
23
  /**
24
  * Get the collection object that is used by this API endpoint. Every API endpoint uses one type of collection object.
25
  *
30
  */
31
  protected function getResourceCollectionObject($count, $_links)
32
  {
33
+ return new ProfileCollection($this->api, $count, $_links);
34
  }
35
+
36
  /**
37
  * Creates a Profile in Mollie.
38
  *
44
  */
45
  public function create(array $data = [], array $filters = [])
46
  {
47
+ return $this->rest_create($data, $filters);
48
  }
49
+
50
  /**
51
  * Retrieve a Profile from Mollie.
52
  *
62
  {
63
  return $this->rest_read($profileId, $parameters);
64
  }
65
+
66
  /**
67
  * Delete a Profile from Mollie.
68
  *
78
  {
79
  return $this->rest_delete($profileId);
80
  }
81
+
82
  /**
83
  * Retrieves a collection of Profiles from Mollie.
84
  *
93
  {
94
  return $this->rest_list($from, $limit, $parameters);
95
  }
96
+
97
+
98
+ }
includes/mollie-api-php/src/Endpoints/RefundEndpoint.php CHANGED
@@ -5,9 +5,11 @@ namespace Mollie\Api\Endpoints;
5
  use Mollie\Api\Exceptions\ApiException;
6
  use Mollie\Api\Resources\Refund;
7
  use Mollie\Api\Resources\RefundCollection;
8
- class RefundEndpoint extends \Mollie\Api\Endpoints\EndpointAbstract
 
9
  {
10
  protected $resourcePath = "refunds";
 
11
  /**
12
  * Get the object that is used by this API endpoint. Every API endpoint uses one type of object.
13
  *
@@ -15,8 +17,9 @@ class RefundEndpoint extends \Mollie\Api\Endpoints\EndpointAbstract
15
  */
16
  protected function getResourceObject()
17
  {
18
- return new \Mollie\Api\Resources\Refund($this->api);
19
  }
 
20
  /**
21
  * Get the collection object that is used by this API endpoint. Every API endpoint uses one type of collection object.
22
  *
@@ -27,8 +30,9 @@ class RefundEndpoint extends \Mollie\Api\Endpoints\EndpointAbstract
27
  */
28
  protected function getResourceCollectionObject($count, $_links)
29
  {
30
- return new \Mollie\Api\Resources\RefundCollection($this->api, $count, $_links);
31
  }
 
32
  /**
33
  * Retrieves a collection of Refunds from Mollie.
34
  *
5
  use Mollie\Api\Exceptions\ApiException;
6
  use Mollie\Api\Resources\Refund;
7
  use Mollie\Api\Resources\RefundCollection;
8
+
9
+ class RefundEndpoint extends EndpointAbstract
10
  {
11
  protected $resourcePath = "refunds";
12
+
13
  /**
14
  * Get the object that is used by this API endpoint. Every API endpoint uses one type of object.
15
  *
17
  */
18
  protected function getResourceObject()
19
  {
20
+ return new Refund($this->api);
21
  }
22
+
23
  /**
24
  * Get the collection object that is used by this API endpoint. Every API endpoint uses one type of collection object.
25
  *
30
  */
31
  protected function getResourceCollectionObject($count, $_links)
32
  {
33
+ return new RefundCollection($this->api, $count, $_links);
34
  }
35
+
36
  /**
37
  * Retrieves a collection of Refunds from Mollie.
38
  *
includes/mollie-api-php/src/Endpoints/SettlementsEndpoint.php CHANGED
@@ -5,9 +5,11 @@ namespace Mollie\Api\Endpoints;
5
  use Mollie\Api\Exceptions\ApiException;
6
  use Mollie\Api\Resources\Settlement;
7
  use Mollie\Api\Resources\SettlementCollection;
8
- class SettlementsEndpoint extends \Mollie\Api\Endpoints\EndpointAbstract
 
9
  {
10
  protected $resourcePath = "settlements";
 
11
  /**
12
  * Get the object that is used by this API. Every API uses one type of object.
13
  *
@@ -15,8 +17,9 @@ class SettlementsEndpoint extends \Mollie\Api\Endpoints\EndpointAbstract
15
  */
16
  protected function getResourceObject()
17
  {
18
- return new \Mollie\Api\Resources\Settlement($this->api);
19
  }
 
20
  /**
21
  * Get the collection object that is used by this API. Every API uses one type of collection object.
22
  *
@@ -27,8 +30,9 @@ class SettlementsEndpoint extends \Mollie\Api\Endpoints\EndpointAbstract
27
  */
28
  protected function getResourceCollectionObject($count, $_links)
29
  {
30
- return new \Mollie\Api\Resources\SettlementCollection($this->api, $count, $_links);
31
  }
 
32
  /**
33
  * Retrieve a single settlement from Mollie.
34
  *
@@ -41,8 +45,9 @@ class SettlementsEndpoint extends \Mollie\Api\Endpoints\EndpointAbstract
41
  */
42
  public function get($settlementId, array $parameters = [])
43
  {
44
- return parent::rest_read($settlementId, $parameters);
45
  }
 
46
  /**
47
  * Retrieve the details of the current settlement that has not yet been paid out.
48
  *
@@ -53,6 +58,7 @@ class SettlementsEndpoint extends \Mollie\Api\Endpoints\EndpointAbstract
53
  {
54
  return parent::rest_read("next", []);
55
  }
 
56
  /**
57
  * Retrieve the details of the open balance of the organization.
58
  *
@@ -63,6 +69,7 @@ class SettlementsEndpoint extends \Mollie\Api\Endpoints\EndpointAbstract
63
  {
64
  return parent::rest_read("open", []);
65
  }
 
66
  /**
67
  * Retrieves a collection of Settlements from Mollie.
68
  *
@@ -77,4 +84,4 @@ class SettlementsEndpoint extends \Mollie\Api\Endpoints\EndpointAbstract
77
  {
78
  return $this->rest_list($from, $limit, $parameters);
79
  }
80
- }
5
  use Mollie\Api\Exceptions\ApiException;
6
  use Mollie\Api\Resources\Settlement;
7
  use Mollie\Api\Resources\SettlementCollection;
8
+
9
+ class SettlementsEndpoint extends EndpointAbstract
10
  {
11
  protected $resourcePath = "settlements";
12
+
13
  /**
14
  * Get the object that is used by this API. Every API uses one type of object.
15
  *
17
  */
18
  protected function getResourceObject()
19
  {
20
+ return new Settlement($this->api);
21
  }
22
+
23
  /**
24
  * Get the collection object that is used by this API. Every API uses one type of collection object.
25
  *
30
  */
31
  protected function getResourceCollectionObject($count, $_links)
32
  {
33
+ return new SettlementCollection($this->api, $count, $_links);
34
  }
35
+
36
  /**
37
  * Retrieve a single settlement from Mollie.
38
  *
45
  */
46
  public function get($settlementId, array $parameters = [])
47
  {
48
+ return parent::rest_read($settlementId, $parameters);
49
  }
50
+
51
  /**
52
  * Retrieve the details of the current settlement that has not yet been paid out.
53
  *
58
  {
59
  return parent::rest_read("next", []);
60
  }
61
+
62
  /**
63
  * Retrieve the details of the open balance of the organization.
64
  *
69
  {
70
  return parent::rest_read("open", []);
71
  }
72
+
73
  /**
74
  * Retrieves a collection of Settlements from Mollie.
75
  *
84
  {
85
  return $this->rest_list($from, $limit, $parameters);
86
  }
87
+ }
includes/mollie-api-php/src/Endpoints/SubscriptionEndpoint.php CHANGED
@@ -7,9 +7,11 @@ use Mollie\Api\Resources\BaseResource;
7
  use Mollie\Api\Resources\Customer;
8
  use Mollie\Api\Resources\Subscription;
9
  use Mollie\Api\Resources\SubscriptionCollection;
10
- class SubscriptionEndpoint extends \Mollie\Api\Endpoints\EndpointAbstract
 
11
  {
12
  protected $resourcePath = "customers_subscriptions";
 
13
  /**
14
  * Get the object that is used by this API endpoint. Every API endpoint uses one type of object.
15
  *
@@ -17,8 +19,9 @@ class SubscriptionEndpoint extends \Mollie\Api\Endpoints\EndpointAbstract
17
  */
18
  protected function getResourceObject()
19
  {
20
- return new \Mollie\Api\Resources\Subscription($this->api);
21
  }
 
22
  /**
23
  * Get the collection object that is used by this API endpoint. Every API endpoint uses one type of collection object.
24
  *
@@ -29,8 +32,9 @@ class SubscriptionEndpoint extends \Mollie\Api\Endpoints\EndpointAbstract
29
  */
30
  protected function getResourceCollectionObject($count, $_links)
31
  {
32
- return new \Mollie\Api\Resources\SubscriptionCollection($this->api, $count, $_links);
33
  }
 
34
  /**
35
  * Create a subscription for a Customer
36
  *
@@ -40,11 +44,13 @@ class SubscriptionEndpoint extends \Mollie\Api\Endpoints\EndpointAbstract
40
  *
41
  * @return Subscription
42
  */
43
- public function createFor(\Mollie\Api\Resources\Customer $customer, array $options = [], array $filters = [])
44
  {
45
  $this->parentId = $customer->id;
 
46
  return parent::rest_create($options, $filters);
47
  }
 
48
  /**
49
  * @param Customer $customer
50
  * @param string $subscriptionId
@@ -52,11 +58,13 @@ class SubscriptionEndpoint extends \Mollie\Api\Endpoints\EndpointAbstract
52
  *
53
  * @return Subscription
54
  */
55
- public function getFor(\Mollie\Api\Resources\Customer $customer, $subscriptionId, array $parameters = [])
56
  {
57
  $this->parentId = $customer->id;
 
58
  return parent::rest_read($subscriptionId, $parameters);
59
  }
 
60
  /**
61
  * @param Customer $customer
62
  * @param string $from The first resource ID you want to include in your list.
@@ -65,20 +73,23 @@ class SubscriptionEndpoint extends \Mollie\Api\Endpoints\EndpointAbstract
65
  *
66
  * @return SubscriptionCollection
67
  */
68
- public function listFor(\Mollie\Api\Resources\Customer $customer, $from = null, $limit = null, array $parameters = [])
69
  {
70
  $this->parentId = $customer->id;
 
71
  return parent::rest_list($from, $limit, $parameters);
72
  }
 
73
  /**
74
  * @param Customer $customer
75
  * @param string $subscriptionId
76
  *
77
  * @return null
78
  */
79
- public function cancelFor(\Mollie\Api\Resources\Customer $customer, $subscriptionId)
80
  {
81
  $this->parentId = $customer->id;
 
82
  return parent::rest_delete($subscriptionId);
83
  }
84
- }
7
  use Mollie\Api\Resources\Customer;
8
  use Mollie\Api\Resources\Subscription;
9
  use Mollie\Api\Resources\SubscriptionCollection;
10
+
11
+ class SubscriptionEndpoint extends EndpointAbstract
12
  {
13
  protected $resourcePath = "customers_subscriptions";
14
+
15
  /**
16
  * Get the object that is used by this API endpoint. Every API endpoint uses one type of object.
17
  *
19
  */
20
  protected function getResourceObject()
21
  {
22
+ return new Subscription($this->api);
23
  }
24
+
25
  /**
26
  * Get the collection object that is used by this API endpoint. Every API endpoint uses one type of collection object.
27
  *
32
  */
33
  protected function getResourceCollectionObject($count, $_links)
34
  {
35
+ return new SubscriptionCollection($this->api, $count, $_links);
36
  }
37
+
38
  /**
39
  * Create a subscription for a Customer
40
  *
44
  *
45
  * @return Subscription
46
  */
47
+ public function createFor(Customer $customer, array $options = [], array $filters = [])
48
  {
49
  $this->parentId = $customer->id;
50
+
51
  return parent::rest_create($options, $filters);
52
  }
53
+
54
  /**
55
  * @param Customer $customer
56
  * @param string $subscriptionId
58
  *
59
  * @return Subscription
60
  */
61
+ public function getFor(Customer $customer, $subscriptionId, array $parameters = [])
62
  {
63
  $this->parentId = $customer->id;
64
+
65
  return parent::rest_read($subscriptionId, $parameters);
66
  }
67
+
68
  /**
69
  * @param Customer $customer
70
  * @param string $from The first resource ID you want to include in your list.
73
  *
74
  * @return SubscriptionCollection
75
  */
76
+ public function listFor(Customer $customer, $from = null, $limit = null, array $parameters = [])
77
  {
78
  $this->parentId = $customer->id;
79
+
80
  return parent::rest_list($from, $limit, $parameters);
81
  }
82
+
83
  /**
84
  * @param Customer $customer
85
  * @param string $subscriptionId
86
  *
87
  * @return null
88
  */
89
+ public function cancelFor(Customer $customer, $subscriptionId)
90
  {
91
  $this->parentId = $customer->id;
92
+
93
  return parent::rest_delete($subscriptionId);
94
  }
95
+ }
includes/mollie-api-php/src/Exceptions/ApiException.php CHANGED
@@ -8,10 +8,12 @@ class ApiException extends \Exception
8
  * @var string
9
  */
10
  protected $field;
 
11
  /**
12
  * @var string
13
  */
14
  protected $documentationUrl;
 
15
  /**
16
  * @param string $message
17
  * @param int $code
@@ -22,15 +24,20 @@ class ApiException extends \Exception
22
  public function __construct($message = "", $code = 0, $field = null, $documentationUrl = null, \Throwable $previous = null)
23
  {
24
  if (!empty($field)) {
25
- $this->field = (string) $field;
26
  $message .= ". Field: {$this->field}";
27
  }
 
28
  if (!empty($documentationUrl)) {
29
- $this->documentationUrl = (string) $documentationUrl;
30
  $message .= ". Documentation: {$this->documentationUrl}";
31
  }
 
32
  parent::__construct($message, $code, $previous);
 
 
33
  }
 
34
  /**
35
  * @return string
36
  */
@@ -38,6 +45,7 @@ class ApiException extends \Exception
38
  {
39
  return $this->field;
40
  }
 
41
  /**
42
  * @return string
43
  */
8
  * @var string
9
  */
10
  protected $field;
11
+
12
  /**
13
  * @var string
14
  */
15
  protected $documentationUrl;
16
+
17
  /**
18
  * @param string $message
19
  * @param int $code
24
  public function __construct($message = "", $code = 0, $field = null, $documentationUrl = null, \Throwable $previous = null)
25
  {
26
  if (!empty($field)) {
27
+ $this->field = (string)$field;
28
  $message .= ". Field: {$this->field}";
29
  }
30
+
31
  if (!empty($documentationUrl)) {
32
+ $this->documentationUrl = (string)$documentationUrl;
33
  $message .= ". Documentation: {$this->documentationUrl}";
34
  }
35
+
36
  parent::__construct($message, $code, $previous);
37
+
38
+
39
  }
40
+
41
  /**
42
  * @return string
43
  */
45
  {
46
  return $this->field;
47
  }
48
+
49
  /**
50
  * @return string
51
  */
includes/mollie-api-php/src/Exceptions/IncompatiblePlatform.php CHANGED
@@ -2,7 +2,7 @@
2
 
3
  namespace Mollie\Api\Exceptions;
4
 
5
- class IncompatiblePlatform extends \Mollie\Api\Exceptions\ApiException
6
  {
7
  const INCOMPATIBLE_PHP_VERSION = 1000;
8
  const INCOMPATIBLE_CURL_EXTENSION = 2000;
2
 
3
  namespace Mollie\Api\Exceptions;
4
 
5
+ class IncompatiblePlatform extends ApiException
6
  {
7
  const INCOMPATIBLE_PHP_VERSION = 1000;
8
  const INCOMPATIBLE_CURL_EXTENSION = 2000;
includes/mollie-api-php/src/MollieApiClient.php CHANGED
@@ -2,10 +2,10 @@
2
 
3
  namespace Mollie\Api;
4
 
5
- use _PhpScoper5b6804f9734c8\GuzzleHttp\Client;
6
- use _PhpScoper5b6804f9734c8\GuzzleHttp\ClientInterface;
7
- use _PhpScoper5b6804f9734c8\GuzzleHttp\Exception\GuzzleException;
8
- use _PhpScoper5b6804f9734c8\GuzzleHttp\Psr7\Request;
9
  use Mollie\Api\Endpoints\CustomerEndpoint;
10
  use Mollie\Api\Endpoints\CustomerPaymentsEndpoint;
11
  use Mollie\Api\Endpoints\InvoiceEndpoint;
@@ -19,22 +19,26 @@ use Mollie\Api\Endpoints\SettlementsEndpoint;
19
  use Mollie\Api\Endpoints\SubscriptionEndpoint;
20
  use Mollie\Api\Exceptions\ApiException;
21
  use Mollie\Api\Exceptions\IncompatiblePlatform;
22
- use _PhpScoper5b6804f9734c8\Psr\Http\Message\ResponseInterface;
23
- use _PhpScoper5b6804f9734c8\Psr\Http\Message\StreamInterface;
 
24
  class MollieApiClient
25
  {
26
  /**
27
  * Version of our client.
28
  */
29
- const CLIENT_VERSION = "2.0.10";
 
30
  /**
31
  * Endpoint of the remote API.
32
  */
33
  const API_ENDPOINT = "https://api.mollie.com";
 
34
  /**
35
  * Version of the remote API.
36
  */
37
  const API_VERSION = "v2";
 
38
  /**
39
  * HTTP Methods
40
  */
@@ -42,127 +46,155 @@ class MollieApiClient
42
  const HTTP_POST = "POST";
43
  const HTTP_DELETE = "DELETE";
44
  const HTTP_PATCH = "PATCH";
 
45
  /**
46
  * HTTP status codes
47
  */
48
  const HTTP_NO_CONTENT = 204;
 
49
  /**
50
  * @var ClientInterface
51
  */
52
  protected $httpClient;
 
53
  /**
54
  * @var string
55
  */
56
  protected $apiEndpoint = self::API_ENDPOINT;
 
57
  /**
58
  * RESTful Payments resource.
59
  *
60
  * @var PaymentEndpoint
61
  */
62
  public $payments;
 
63
  /**
64
  * RESTful Methods resource.
65
  *
66
  * @var MethodEndpoint
67
  */
68
  public $methods;
 
69
  /**
70
  * RESTful Customers resource.
71
  *
72
  * @var CustomerEndpoint
73
  */
74
  public $customers;
 
75
  /**
76
  * RESTful Customer payments resource.
77
  *
78
  * @var CustomerPaymentsEndpoint
79
  */
80
  public $customerPayments;
 
81
  /**
82
  * @var SettlementsEndpoint
83
  */
84
  public $settlements;
 
85
  /**
86
  * RESTful Subscription resource.
87
  *
88
  * @var SubscriptionEndpoint
89
  */
90
  public $subscriptions;
 
91
  /**
92
  * RESTful Mandate resource.
93
  *
94
  * @var MandateEndpoint
95
  */
96
  public $mandates;
 
97
  /**
98
  * @var ProfileEndpoint
99
  */
100
  public $profiles;
 
101
  /**
102
  * RESTful Invoice resource.
103
  *
104
  * @var InvoiceEndpoint
105
  */
106
  public $invoices;
 
107
  /**
108
  * RESTful Refunds resource.
109
  *
110
  * @var RefundEndpoint
111
  */
112
  public $refunds;
 
113
  /**
114
  * RESTful Refunds resource.
115
  *
116
  * @var PaymentRefundEndpoint
117
  */
118
  public $paymentRefunds;
 
119
  /**
120
  * @var string
121
  */
122
  protected $apiKey;
 
123
  /**
124
  * True if an OAuth access token is set as API key.
125
  *
126
  * @var bool
127
  */
128
  protected $oauthAccess;
 
129
  /**
130
  * @var array
131
  */
132
  protected $versionStrings = [];
 
133
  /**
134
  * @var int
135
  */
136
  protected $lastHttpResponseStatusCode;
 
137
  /**
138
  * @param ClientInterface $httpClient
139
  *
140
  * @throws IncompatiblePlatform
141
  */
142
- public function __construct(\_PhpScoper5b6804f9734c8\GuzzleHttp\ClientInterface $httpClient = null)
143
  {
144
- $this->httpClient = $httpClient ? $httpClient : new \_PhpScoper5b6804f9734c8\GuzzleHttp\Client([\_PhpScoper5b6804f9734c8\GuzzleHttp\RequestOptions::VERIFY => \_PhpScoper5b6804f9734c8\Composer\CaBundle\CaBundle::getBundledCaBundlePath()]);
145
- $compatibilityChecker = new \Mollie\Api\CompatibilityChecker();
 
 
 
 
 
146
  $compatibilityChecker->checkCompatibility();
 
147
  $this->initializeEndpoints();
 
148
  $this->addVersionString("Mollie/" . self::CLIENT_VERSION);
149
- $this->addVersionString("PHP/" . \phpversion());
150
- $this->addVersionString("Guzzle/" . \_PhpScoper5b6804f9734c8\GuzzleHttp\ClientInterface::VERSION);
151
  }
 
152
  public function initializeEndpoints()
153
  {
154
- $this->payments = new \Mollie\Api\Endpoints\PaymentEndpoint($this);
155
- $this->methods = new \Mollie\Api\Endpoints\MethodEndpoint($this);
156
- $this->customers = new \Mollie\Api\Endpoints\CustomerEndpoint($this);
157
- $this->settlements = new \Mollie\Api\Endpoints\SettlementsEndpoint($this);
158
- $this->subscriptions = new \Mollie\Api\Endpoints\SubscriptionEndpoint($this);
159
- $this->customerPayments = new \Mollie\Api\Endpoints\CustomerPaymentsEndpoint($this);
160
- $this->mandates = new \Mollie\Api\Endpoints\MandateEndpoint($this);
161
- $this->invoices = new \Mollie\Api\Endpoints\InvoiceEndpoint($this);
162
- $this->profiles = new \Mollie\Api\Endpoints\ProfileEndpoint($this);
163
- $this->refunds = new \Mollie\Api\Endpoints\RefundEndpoint($this);
164
- $this->paymentRefunds = new \Mollie\Api\Endpoints\PaymentRefundEndpoint($this);
165
  }
 
166
  /**
167
  * @param string $url
168
  *
@@ -170,9 +202,10 @@ class MollieApiClient
170
  */
171
  public function setApiEndpoint($url)
172
  {
173
- $this->apiEndpoint = \rtrim(\trim($url), '/');
174
  return $this;
175
  }
 
176
  /**
177
  * @return string
178
  */
@@ -180,6 +213,7 @@ class MollieApiClient
180
  {
181
  return $this->apiEndpoint;
182
  }
 
183
  /**
184
  * @param string $apiKey The Mollie API key, starting with 'test_' or 'live_'
185
  *
@@ -188,14 +222,17 @@ class MollieApiClient
188
  */
189
  public function setApiKey($apiKey)
190
  {
191
- $apiKey = \trim($apiKey);
192
- if (!\preg_match('/^(live|test)_\\w{30,}$/', $apiKey)) {
193
- throw new \Mollie\Api\Exceptions\ApiException("Invalid API key: '{$apiKey}'. An API key must start with 'test_' or 'live_' and must be at least 30 characters long.");
 
194
  }
 
195
  $this->apiKey = $apiKey;
196
- $this->oauthAccess = \false;
197
  return $this;
198
  }
 
199
  /**
200
  * @param string $accessToken OAuth access token, starting with 'access_'
201
  *
@@ -204,14 +241,17 @@ class MollieApiClient
204
  */
205
  public function setAccessToken($accessToken)
206
  {
207
- $accessToken = \trim($accessToken);
208
- if (!\preg_match('/^access_\\w+$/', $accessToken)) {
209
- throw new \Mollie\Api\Exceptions\ApiException("Invalid OAuth access token: '{$accessToken}'. An access token must start with 'access_'.");
 
210
  }
 
211
  $this->apiKey = $accessToken;
212
- $this->oauthAccess = \true;
213
  return $this;
214
  }
 
215
  /**
216
  * Returns null if no API key has been set yet.
217
  *
@@ -221,6 +261,7 @@ class MollieApiClient
221
  {
222
  return $this->oauthAccess;
223
  }
 
224
  /**
225
  * @param string $versionString
226
  *
@@ -228,9 +269,10 @@ class MollieApiClient
228
  */
229
  public function addVersionString($versionString)
230
  {
231
- $this->versionStrings[] = \str_replace([" ", "\t", "\n", "\r"], '-', $versionString);
232
  return $this;
233
  }
 
234
  /**
235
  * Perform an http call. This method is used by the resource specific classes. Please use the $payments property to
236
  * perform operations on payments.
@@ -250,8 +292,10 @@ class MollieApiClient
250
  public function performHttpCall($httpMethod, $apiMethod, $httpBody = null)
251
  {
252
  $url = $this->apiEndpoint . "/" . self::API_VERSION . "/" . $apiMethod;
 
253
  return $this->performHttpCallToFullUrl($httpMethod, $url, $httpBody);
254
  }
 
255
  /**
256
  * Perform an http call to a full url. This method is used by the resource specific classes.
257
  *
@@ -270,27 +314,40 @@ class MollieApiClient
270
  public function performHttpCallToFullUrl($httpMethod, $url, $httpBody = null)
271
  {
272
  if (empty($this->apiKey)) {
273
- throw new \Mollie\Api\Exceptions\ApiException("You have not set an API key or OAuth access token. Please use setApiKey() to set the API key.");
274
  }
275
- $userAgent = \implode(' ', $this->versionStrings);
 
 
276
  if ($this->usesOAuth()) {
277
  $userAgent .= " OAuth/2.0";
278
  }
279
- $headers = ['Accept' => "application/json", 'Authorization' => "Bearer {$this->apiKey}", 'User-Agent' => $userAgent];
280
- if (\function_exists("php_uname")) {
281
- $headers['X-Mollie-Client-Info'] = \php_uname();
 
 
 
 
 
 
282
  }
283
- $request = new \_PhpScoper5b6804f9734c8\GuzzleHttp\Psr7\Request($httpMethod, $url, $headers, $httpBody);
 
 
284
  try {
285
- $response = $this->httpClient->send($request, ['http_errors' => \false]);
286
- } catch (\_PhpScoper5b6804f9734c8\GuzzleHttp\Exception\GuzzleException $e) {
287
- throw new \Mollie\Api\Exceptions\ApiException($e->getMessage(), $e->getCode(), $e);
288
  }
 
289
  if (!$response) {
290
- throw new \Mollie\Api\Exceptions\ApiException("Did not receive API response.");
291
  }
 
292
  return $this->parseResponseBody($response);
293
  }
 
294
  /**
295
  * Parse the PSR-7 Response body
296
  *
@@ -298,32 +355,45 @@ class MollieApiClient
298
  * @return object|null
299
  * @throws ApiException
300
  */
301
- private function parseResponseBody(\_PhpScoper5b6804f9734c8\Psr\Http\Message\ResponseInterface $response)
302
  {
303
  $body = $response->getBody()->getContents();
304
  if (empty($body)) {
305
  if ($response->getStatusCode() === self::HTTP_NO_CONTENT) {
306
  return null;
307
  }
308
- throw new \Mollie\Api\Exceptions\ApiException("No response body found.");
 
309
  }
310
- $object = @\json_decode($body);
311
- if (\json_last_error() !== \JSON_ERROR_NONE) {
312
- throw new \Mollie\Api\Exceptions\ApiException("Unable to decode Mollie response: '{$body}'.");
 
 
313
  }
 
314
  if ($response->getStatusCode() >= 400) {
315
  $field = null;
316
  if (!empty($object->field)) {
317
  $field = $object->field;
318
  }
 
319
  $documentationUrl = null;
320
  if (!empty($object->_links) && !empty($object->_links->documentation)) {
321
  $documentationUrl = $object->_links->documentation->href;
322
  }
323
- throw new \Mollie\Api\Exceptions\ApiException("Error executing API call ({$object->status}: {$object->title}): {$object->detail}", $response->getStatusCode(), $field, $documentationUrl);
 
 
 
 
 
 
324
  }
 
325
  return $object;
326
  }
 
327
  /**
328
  * Serialization can be used for caching. Of course doing so can be dangerous but some like to live dangerously.
329
  *
@@ -341,6 +411,7 @@ class MollieApiClient
341
  {
342
  return ["apiEndpoint"];
343
  }
 
344
  /**
345
  * When unserializing a collection or a resource, this class should restore itself.
346
  *
2
 
3
  namespace Mollie\Api;
4
 
5
+ use GuzzleHttp\Client;
6
+ use GuzzleHttp\ClientInterface;
7
+ use GuzzleHttp\Exception\GuzzleException;
8
+ use GuzzleHttp\Psr7\Request;
9
  use Mollie\Api\Endpoints\CustomerEndpoint;
10
  use Mollie\Api\Endpoints\CustomerPaymentsEndpoint;
11
  use Mollie\Api\Endpoints\InvoiceEndpoint;
19
  use Mollie\Api\Endpoints\SubscriptionEndpoint;
20
  use Mollie\Api\Exceptions\ApiException;
21
  use Mollie\Api\Exceptions\IncompatiblePlatform;
22
+ use Psr\Http\Message\ResponseInterface;
23
+ use Psr\Http\Message\StreamInterface;
24
+
25
  class MollieApiClient
26
  {
27
  /**
28
  * Version of our client.
29
  */
30
+ const CLIENT_VERSION = "2.0.11";
31
+
32
  /**
33
  * Endpoint of the remote API.
34
  */
35
  const API_ENDPOINT = "https://api.mollie.com";
36
+
37
  /**
38
  * Version of the remote API.
39
  */
40
  const API_VERSION = "v2";
41
+
42
  /**
43
  * HTTP Methods
44
  */
46
  const HTTP_POST = "POST";
47
  const HTTP_DELETE = "DELETE";
48
  const HTTP_PATCH = "PATCH";
49
+
50
  /**
51
  * HTTP status codes
52
  */
53
  const HTTP_NO_CONTENT = 204;
54
+
55
  /**
56
  * @var ClientInterface
57
  */
58
  protected $httpClient;
59
+
60
  /**
61
  * @var string
62
  */
63
  protected $apiEndpoint = self::API_ENDPOINT;
64
+
65
  /**
66
  * RESTful Payments resource.
67
  *
68
  * @var PaymentEndpoint
69
  */
70
  public $payments;
71
+
72
  /**
73
  * RESTful Methods resource.
74
  *
75
  * @var MethodEndpoint
76
  */
77
  public $methods;
78
+
79
  /**
80
  * RESTful Customers resource.
81
  *
82
  * @var CustomerEndpoint
83
  */
84
  public $customers;
85
+
86
  /**
87
  * RESTful Customer payments resource.
88
  *
89
  * @var CustomerPaymentsEndpoint
90
  */
91
  public $customerPayments;
92
+
93
  /**
94
  * @var SettlementsEndpoint
95
  */
96
  public $settlements;
97
+
98
  /**
99
  * RESTful Subscription resource.
100
  *
101
  * @var SubscriptionEndpoint
102
  */
103
  public $subscriptions;
104
+
105
  /**
106
  * RESTful Mandate resource.
107
  *
108
  * @var MandateEndpoint
109
  */
110
  public $mandates;
111
+
112
  /**
113
  * @var ProfileEndpoint
114
  */
115
  public $profiles;
116
+
117
  /**
118
  * RESTful Invoice resource.
119
  *
120
  * @var InvoiceEndpoint
121
  */
122
  public $invoices;
123
+
124
  /**
125
  * RESTful Refunds resource.
126
  *
127
  * @var RefundEndpoint
128
  */
129
  public $refunds;
130
+
131
  /**
132
  * RESTful Refunds resource.
133
  *
134
  * @var PaymentRefundEndpoint
135
  */
136
  public $paymentRefunds;
137
+
138
  /**
139
  * @var string
140
  */
141
  protected $apiKey;
142
+
143
  /**
144
  * True if an OAuth access token is set as API key.
145
  *
146
  * @var bool
147
  */
148
  protected $oauthAccess;
149
+
150
  /**
151
  * @var array
152
  */
153
  protected $versionStrings = [];
154
+
155
  /**
156
  * @var int
157
  */
158
  protected $lastHttpResponseStatusCode;
159
+
160
  /**
161
  * @param ClientInterface $httpClient
162
  *
163
  * @throws IncompatiblePlatform
164
  */
165
+ public function __construct(ClientInterface $httpClient = null)
166
  {
167
+ $this->httpClient = $httpClient ?
168
+ $httpClient :
169
+ new Client([
170
+ \GuzzleHttp\RequestOptions::VERIFY => \Composer\CaBundle\CaBundle::getBundledCaBundlePath()
171
+ ]);
172
+
173
+ $compatibilityChecker = new CompatibilityChecker();
174
  $compatibilityChecker->checkCompatibility();
175
+
176
  $this->initializeEndpoints();
177
+
178
  $this->addVersionString("Mollie/" . self::CLIENT_VERSION);
179
+ $this->addVersionString("PHP/" . phpversion());
180
+ $this->addVersionString("Guzzle/" . ClientInterface::VERSION);
181
  }
182
+
183
  public function initializeEndpoints()
184
  {
185
+ $this->payments = new PaymentEndpoint($this);
186
+ $this->methods = new MethodEndpoint($this);
187
+ $this->customers = new CustomerEndpoint($this);
188
+ $this->settlements = new SettlementsEndpoint($this);
189
+ $this->subscriptions = new SubscriptionEndpoint($this);
190
+ $this->customerPayments = new CustomerPaymentsEndpoint($this);
191
+ $this->mandates = new MandateEndpoint($this);
192
+ $this->invoices = new InvoiceEndpoint($this);
193
+ $this->profiles = new ProfileEndpoint($this);
194
+ $this->refunds = new RefundEndpoint($this);
195
+ $this->paymentRefunds = new PaymentRefundEndpoint($this);
196
  }
197
+
198
  /**
199
  * @param string $url
200
  *
202
  */
203
  public function setApiEndpoint($url)
204
  {
205
+ $this->apiEndpoint = rtrim(trim($url), '/');
206
  return $this;
207
  }
208
+
209
  /**
210
  * @return string
211
  */
213
  {
214
  return $this->apiEndpoint;
215
  }
216
+
217
  /**
218
  * @param string $apiKey The Mollie API key, starting with 'test_' or 'live_'
219
  *
222
  */
223
  public function setApiKey($apiKey)
224
  {
225
+ $apiKey = trim($apiKey);
226
+
227
+ if (!preg_match('/^(live|test)_\w{30,}$/', $apiKey)) {
228
+ throw new ApiException("Invalid API key: '{$apiKey}'. An API key must start with 'test_' or 'live_' and must be at least 30 characters long.");
229
  }
230
+
231
  $this->apiKey = $apiKey;
232
+ $this->oauthAccess = false;
233
  return $this;
234
  }
235
+
236
  /**
237
  * @param string $accessToken OAuth access token, starting with 'access_'
238
  *
241
  */
242
  public function setAccessToken($accessToken)
243
  {
244
+ $accessToken = trim($accessToken);
245
+
246
+ if (!preg_match('/^access_\w+$/', $accessToken)) {
247
+ throw new ApiException("Invalid OAuth access token: '{$accessToken}'. An access token must start with 'access_'.");
248
  }
249
+
250
  $this->apiKey = $accessToken;
251
+ $this->oauthAccess = true;
252
  return $this;
253
  }
254
+
255
  /**
256
  * Returns null if no API key has been set yet.
257
  *
261
  {
262
  return $this->oauthAccess;
263
  }
264
+
265
  /**
266
  * @param string $versionString
267
  *
269
  */
270
  public function addVersionString($versionString)
271
  {
272
+ $this->versionStrings[] = str_replace([" ", "\t", "\n", "\r"], '-', $versionString);
273
  return $this;
274
  }
275
+
276
  /**
277
  * Perform an http call. This method is used by the resource specific classes. Please use the $payments property to
278
  * perform operations on payments.
292
  public function performHttpCall($httpMethod, $apiMethod, $httpBody = null)
293
  {
294
  $url = $this->apiEndpoint . "/" . self::API_VERSION . "/" . $apiMethod;
295
+
296
  return $this->performHttpCallToFullUrl($httpMethod, $url, $httpBody);
297
  }
298
+
299
  /**
300
  * Perform an http call to a full url. This method is used by the resource specific classes.
301
  *
314
  public function performHttpCallToFullUrl($httpMethod, $url, $httpBody = null)
315
  {
316
  if (empty($this->apiKey)) {
317
+ throw new ApiException("You have not set an API key or OAuth access token. Please use setApiKey() to set the API key.");
318
  }
319
+
320
+ $userAgent = implode(' ', $this->versionStrings);
321
+
322
  if ($this->usesOAuth()) {
323
  $userAgent .= " OAuth/2.0";
324
  }
325
+
326
+ $headers = [
327
+ 'Accept' => "application/json",
328
+ 'Authorization' => "Bearer {$this->apiKey}",
329
+ 'User-Agent' => $userAgent,
330
+ ];
331
+
332
+ if (function_exists("php_uname")) {
333
+ $headers['X-Mollie-Client-Info'] = php_uname();
334
  }
335
+
336
+ $request = new Request($httpMethod, $url, $headers, $httpBody);
337
+
338
  try {
339
+ $response = $this->httpClient->send($request, ['http_errors' => false]);
340
+ } catch (GuzzleException $e) {
341
+ throw new ApiException($e->getMessage(), $e->getCode(), $e);
342
  }
343
+
344
  if (!$response) {
345
+ throw new ApiException("Did not receive API response.");
346
  }
347
+
348
  return $this->parseResponseBody($response);
349
  }
350
+
351
  /**
352
  * Parse the PSR-7 Response body
353
  *
355
  * @return object|null
356
  * @throws ApiException
357
  */
358
+ private function parseResponseBody(ResponseInterface $response)
359
  {
360
  $body = $response->getBody()->getContents();
361
  if (empty($body)) {
362
  if ($response->getStatusCode() === self::HTTP_NO_CONTENT) {
363
  return null;
364
  }
365
+
366
+ throw new ApiException("No response body found.");
367
  }
368
+
369
+ $object = @json_decode($body);
370
+
371
+ if (json_last_error() !== JSON_ERROR_NONE) {
372
+ throw new ApiException("Unable to decode Mollie response: '{$body}'.");
373
  }
374
+
375
  if ($response->getStatusCode() >= 400) {
376
  $field = null;
377
  if (!empty($object->field)) {
378
  $field = $object->field;
379
  }
380
+
381
  $documentationUrl = null;
382
  if (!empty($object->_links) && !empty($object->_links->documentation)) {
383
  $documentationUrl = $object->_links->documentation->href;
384
  }
385
+
386
+ throw new ApiException(
387
+ "Error executing API call ({$object->status}: {$object->title}): {$object->detail}",
388
+ $response->getStatusCode(),
389
+ $field,
390
+ $documentationUrl
391
+ );
392
  }
393
+
394
  return $object;
395
  }
396
+
397
  /**
398
  * Serialization can be used for caching. Of course doing so can be dangerous but some like to live dangerously.
399
  *
411
  {
412
  return ["apiEndpoint"];
413
  }
414
+
415
  /**
416
  * When unserializing a collection or a resource, this class should restore itself.
417
  *
includes/mollie-api-php/src/Resources/BaseCollection.php CHANGED
@@ -10,10 +10,12 @@ abstract class BaseCollection extends \ArrayObject
10
  * @var int
11
  */
12
  public $count;
 
13
  /**
14
  * @var object[]
15
  */
16
  public $_links;
 
17
  /**
18
  * @param int $count
19
  * @param object[] $_links
@@ -23,8 +25,9 @@ abstract class BaseCollection extends \ArrayObject
23
  $this->count = $count;
24
  $this->_links = $_links;
25
  }
 
26
  /**
27
  * @return string
28
  */
29
- public abstract function getCollectionResourceName();
30
  }
10
  * @var int
11
  */
12
  public $count;
13
+
14
  /**
15
  * @var object[]
16
  */
17
  public $_links;
18
+
19
  /**
20
  * @param int $count
21
  * @param object[] $_links
25
  $this->count = $count;
26
  $this->_links = $_links;
27
  }
28
+
29
  /**
30
  * @return string
31
  */
32
+ abstract public function getCollectionResourceName();
33
  }
includes/mollie-api-php/src/Resources/BaseResource.php CHANGED
@@ -3,17 +3,19 @@
3
  namespace Mollie\Api\Resources;
4
 
5
  use Mollie\Api\MollieApiClient;
 
6
  abstract class BaseResource
7
  {
8
  /**
9
  * @var MollieApiClient
10
  */
11
  protected $client;
 
12
  /**
13
  * @param $client
14
  */
15
- public function __construct(\Mollie\Api\MollieApiClient $client)
16
  {
17
  $this->client = $client;
18
  }
19
- }
3
  namespace Mollie\Api\Resources;
4
 
5
  use Mollie\Api\MollieApiClient;
6
+
7
  abstract class BaseResource
8
  {
9
  /**
10
  * @var MollieApiClient
11
  */
12
  protected $client;
13
+
14
  /**
15
  * @param $client
16
  */
17
+ public function __construct(MollieApiClient $client)
18
  {
19
  $this->client = $client;
20
  }
21
+ }
includes/mollie-api-php/src/Resources/Chargeback.php CHANGED
@@ -8,7 +8,7 @@ namespace Mollie\Api\Resources;
8
  * @method Refund create(array $data = [], array $filters = [])
9
  * @method Refund delete($refundId)
10
  */
11
- class Chargeback extends \Mollie\Api\Resources\BaseResource
12
  {
13
  /**
14
  * Id of the payment method.
@@ -16,12 +16,14 @@ class Chargeback extends \Mollie\Api\Resources\BaseResource
16
  * @var string
17
  */
18
  public $id;
 
19
  /**
20
  * The $amount that was refunded.
21
  *
22
  * @var object
23
  */
24
  public $amount;
 
25
  /**
26
  * UTC datetime the payment was created in ISO-8601 format.
27
  *
@@ -29,20 +31,24 @@ class Chargeback extends \Mollie\Api\Resources\BaseResource
29
  * @var string|null
30
  */
31
  public $createdAt;
 
32
  /**
33
  * The payment id that was refunded.
34
  *
35
  * @var string
36
  */
37
  public $paymentId;
 
38
  /**
39
  * The settlement amount
40
  *
41
  * @var object
42
  */
43
  public $settlementAmount;
 
44
  /**
45
  * @var object[]
46
  */
47
  public $_links;
 
48
  }
8
  * @method Refund create(array $data = [], array $filters = [])
9
  * @method Refund delete($refundId)
10
  */
11
+ class Chargeback extends BaseResource
12
  {
13
  /**
14
  * Id of the payment method.
16
  * @var string
17
  */
18
  public $id;
19
+
20
  /**
21
  * The $amount that was refunded.
22
  *
23
  * @var object
24
  */
25
  public $amount;
26
+
27
  /**
28
  * UTC datetime the payment was created in ISO-8601 format.
29
  *
31
  * @var string|null
32
  */
33
  public $createdAt;
34
+
35
  /**
36
  * The payment id that was refunded.
37
  *
38
  * @var string
39
  */
40
  public $paymentId;
41
+
42
  /**
43
  * The settlement amount
44
  *
45
  * @var object
46
  */
47
  public $settlementAmount;
48
+
49
  /**
50
  * @var object[]
51
  */
52
  public $_links;
53
+
54
  }
includes/mollie-api-php/src/Resources/ChargebackCollection.php CHANGED
@@ -2,7 +2,7 @@
2
 
3
  namespace Mollie\Api\Resources;
4
 
5
- class ChargebackCollection extends \Mollie\Api\Resources\CursorCollection
6
  {
7
  /**
8
  * @return string
@@ -11,11 +11,12 @@ class ChargebackCollection extends \Mollie\Api\Resources\CursorCollection
11
  {
12
  return "chargebacks";
13
  }
 
14
  /**
15
  * @return BaseResource
16
  */
17
  protected function createResourceObject()
18
  {
19
- return new \Mollie\Api\Resources\Chargeback($this->client);
20
  }
21
- }
2
 
3
  namespace Mollie\Api\Resources;
4
 
5
+ class ChargebackCollection extends CursorCollection
6
  {
7
  /**
8
  * @return string
11
  {
12
  return "chargebacks";
13
  }
14
+
15
  /**
16
  * @return BaseResource
17
  */
18
  protected function createResourceObject()
19
  {
20
+ return new Chargeback($this->client);
21
  }
22
+ }
includes/mollie-api-php/src/Resources/CursorCollection.php CHANGED
@@ -3,58 +3,72 @@
3
  namespace Mollie\Api\Resources;
4
 
5
  use Mollie\Api\MollieApiClient;
6
- abstract class CursorCollection extends \Mollie\Api\Resources\BaseCollection
 
7
  {
8
  /**
9
  * @var MollieApiClient
10
  */
11
  protected $client;
 
12
  /**
13
  * @param MollieApiClient $client
14
  * @param int $count
15
  * @param object[] $_links
16
  */
17
- public final function __construct(\Mollie\Api\MollieApiClient $client, $count, $_links)
18
  {
19
  parent::__construct($count, $_links);
 
20
  $this->client = $client;
21
  }
 
22
  /**
23
  * @return BaseResource
24
  */
25
- protected abstract function createResourceObject();
 
26
  /**
27
  * Return the next set of resources when available
28
  *
29
  * @return CursorCollection|null
30
  */
31
- public final function next()
32
  {
33
  if (!isset($this->_links->next->href)) {
34
  return null;
35
  }
36
- $result = $this->client->performHttpCallToFullUrl(\Mollie\Api\MollieApiClient::HTTP_GET, $this->_links->next->href);
 
 
37
  $collection = new static($this->client, $result->count, $result->_links);
 
38
  foreach ($result->_embedded->{$collection->getCollectionResourceName()} as $dataResult) {
39
- $collection[] = \Mollie\Api\Resources\ResourceFactory::createFromApiResult($dataResult, $this->createResourceObject());
40
  }
 
41
  return $collection;
42
  }
 
43
  /**
44
  * Return the previous set of resources when available
45
  *
46
  * @return CursorCollection|null
47
  */
48
- public final function previous()
49
  {
50
  if (!isset($this->_links->previous->href)) {
51
  return null;
52
  }
53
- $result = $this->client->performHttpCallToFullUrl(\Mollie\Api\MollieApiClient::HTTP_GET, $this->_links->previous->href);
 
 
54
  $collection = new static($this->client, $result->count, $result->_links);
 
55
  foreach ($result->_embedded->{$collection->getCollectionResourceName()} as $dataResult) {
56
- $collection[] = \Mollie\Api\Resources\ResourceFactory::createFromApiResult($dataResult, $this->createResourceObject());
57
  }
 
58
  return $collection;
59
  }
60
- }
3
  namespace Mollie\Api\Resources;
4
 
5
  use Mollie\Api\MollieApiClient;
6
+
7
+ abstract class CursorCollection extends BaseCollection
8
  {
9
  /**
10
  * @var MollieApiClient
11
  */
12
  protected $client;
13
+
14
  /**
15
  * @param MollieApiClient $client
16
  * @param int $count
17
  * @param object[] $_links
18
  */
19
+ final public function __construct(MollieApiClient $client, $count, $_links)
20
  {
21
  parent::__construct($count, $_links);
22
+
23
  $this->client = $client;
24
  }
25
+
26
  /**
27
  * @return BaseResource
28
  */
29
+ abstract protected function createResourceObject();
30
+
31
  /**
32
  * Return the next set of resources when available
33
  *
34
  * @return CursorCollection|null
35
  */
36
+ final public function next()
37
  {
38
  if (!isset($this->_links->next->href)) {
39
  return null;
40
  }
41
+
42
+ $result = $this->client->performHttpCallToFullUrl(MollieApiClient::HTTP_GET, $this->_links->next->href);
43
+
44
  $collection = new static($this->client, $result->count, $result->_links);
45
+
46
  foreach ($result->_embedded->{$collection->getCollectionResourceName()} as $dataResult) {
47
+ $collection[] = ResourceFactory::createFromApiResult($dataResult, $this->createResourceObject());
48
  }
49
+
50
  return $collection;
51
  }
52
+
53
  /**
54
  * Return the previous set of resources when available
55
  *
56
  * @return CursorCollection|null
57
  */
58
+ final public function previous()
59
  {
60
  if (!isset($this->_links->previous->href)) {
61
  return null;
62
  }
63
+
64
+ $result = $this->client->performHttpCallToFullUrl(MollieApiClient::HTTP_GET, $this->_links->previous->href);
65
+
66
  $collection = new static($this->client, $result->count, $result->_links);
67
+
68
  foreach ($result->_embedded->{$collection->getCollectionResourceName()} as $dataResult) {
69
+ $collection[] = ResourceFactory::createFromApiResult($dataResult, $this->createResourceObject());
70
  }
71
+
72
  return $collection;
73
  }
74
+ }
includes/mollie-api-php/src/Resources/Customer.php CHANGED
@@ -3,52 +3,63 @@
3
  namespace Mollie\Api\Resources;
4
 
5
  use Mollie\Api\MollieApiClient;
6
- class Customer extends \Mollie\Api\Resources\BaseResource
 
7
  {
8
  /**
9
  * @var string
10
  */
11
  public $resource;
 
12
  /**
13
  * Id of the customer.
14
  *
15
  * @var string
16
  */
17
  public $id;
 
18
  /**
19
  * Either "live" or "test". Indicates this being a test or a live (verified) customer.
20
  *
21
  * @var string
22
  */
23
  public $mode;
 
24
  /**
25
  * @var string
26
  */
27
  public $name;
 
28
  /**
29
  * @var string
30
  */
31
  public $email;
 
32
  /**
33
  * @var string|null
34
  */
35
  public $locale;
 
36
  /**
37
  * @var object|mixed|null
38
  */
39
  public $metadata;
 
40
  /**
41
  * @var string[]|array
42
  */
43
  public $recentlyUsedMethods;
 
44
  /**
45
  * @var string
46
  */
47
  public $createdAt;
 
48
  /**
49
  * @var object[]
50
  */
51
  public $_links;
 
52
  /**
53
  * @return Customer
54
  */
@@ -57,10 +68,19 @@ class Customer extends \Mollie\Api\Resources\BaseResource
57
  if (!isset($this->_links->self->href)) {
58
  return $this;
59
  }
60
- $body = \json_encode(array("name" => $this->name, "email" => $this->email, "locale" => $this->locale, "metadata" => $this->metadata));
61
- $result = $this->client->performHttpCallToFullUrl(\Mollie\Api\MollieApiClient::HTTP_PATCH, $this->_links->self->href, $body);
62
- return \Mollie\Api\Resources\ResourceFactory::createFromApiResult($result, new \Mollie\Api\Resources\Customer($this->client));
 
 
 
 
 
 
 
 
63
  }
 
64
  /**
65
  * @param array $options
66
  * @param array $filters
@@ -71,6 +91,7 @@ class Customer extends \Mollie\Api\Resources\BaseResource
71
  {
72
  return $this->client->customerPayments->createFor($this, $options, $filters);
73
  }
 
74
  /**
75
  * Get all payments for this customer
76
  *
@@ -80,6 +101,7 @@ class Customer extends \Mollie\Api\Resources\BaseResource
80
  {
81
  return $this->client->customerPayments->listFor($this, null, null, $this->getPresetOptions());
82
  }
 
83
  /**
84
  * @param array $options
85
  * @param array $filters
@@ -90,6 +112,7 @@ class Customer extends \Mollie\Api\Resources\BaseResource
90
  {
91
  return $this->client->subscriptions->createFor($this, $options, $filters);
92
  }
 
93
  /**
94
  * @param string $subscriptionId
95
  * @param array $parameters
@@ -100,6 +123,7 @@ class Customer extends \Mollie\Api\Resources\BaseResource
100
  {
101
  return $this->client->subscriptions->getFor($this, $subscriptionId, $parameters);
102
  }
 
103
  /**
104
  * @param string $subscriptionId
105
  *
@@ -109,6 +133,7 @@ class Customer extends \Mollie\Api\Resources\BaseResource
109
  {
110
  return $this->client->subscriptions->cancelFor($this, $subscriptionId);
111
  }
 
112
  /**
113
  * Get all subscriptions for this customer
114
  *
@@ -118,6 +143,7 @@ class Customer extends \Mollie\Api\Resources\BaseResource
118
  {
119
  return $this->client->subscriptions->listFor($this, null, null, $this->getPresetOptions());
120
  }
 
121
  /**
122
  * @param array $options
123
  * @param array $filters
@@ -128,6 +154,7 @@ class Customer extends \Mollie\Api\Resources\BaseResource
128
  {
129
  return $this->client->mandates->createFor($this, $options, $filters);
130
  }
 
131
  /**
132
  * @param string $mandateId
133
  * @param array $parameters
@@ -138,6 +165,7 @@ class Customer extends \Mollie\Api\Resources\BaseResource
138
  {
139
  return $this->client->mandates->getFor($this, $mandateId, $parameters);
140
  }
 
141
  /**
142
  * @param string $mandateId
143
  *
@@ -147,6 +175,7 @@ class Customer extends \Mollie\Api\Resources\BaseResource
147
  {
148
  return $this->client->mandates->revokeFor($this, $mandateId);
149
  }
 
150
  /**
151
  * Get all mandates for this customer
152
  *
@@ -156,6 +185,7 @@ class Customer extends \Mollie\Api\Resources\BaseResource
156
  {
157
  return $this->client->mandates->listFor($this, null, null, $this->getPresetOptions());
158
  }
 
159
  /**
160
  * Helper function to check for mandate with status valid
161
  *
@@ -166,11 +196,13 @@ class Customer extends \Mollie\Api\Resources\BaseResource
166
  $mandates = $this->client->mandates->listFor($this, null, null, $this->getPresetOptions());
167
  foreach ($mandates as $mandate) {
168
  if ($mandate->isValid()) {
169
- return \true;
170
  }
171
  }
172
- return \false;
 
173
  }
 
174
  /**
175
  * When accessed by oAuth we want to pass the testmode by default
176
  *
@@ -179,9 +211,10 @@ class Customer extends \Mollie\Api\Resources\BaseResource
179
  private function getPresetOptions()
180
  {
181
  $options = [];
182
- if ($this->client->usesOAuth()) {
183
- $options["testmode"] = $this->mode === "test" ? \true : \false;
184
  }
 
185
  return $options;
186
  }
187
- }
3
  namespace Mollie\Api\Resources;
4
 
5
  use Mollie\Api\MollieApiClient;
6
+
7
+ class Customer extends BaseResource
8
  {
9
  /**
10
  * @var string
11
  */
12
  public $resource;
13
+
14
  /**
15
  * Id of the customer.
16
  *
17
  * @var string
18
  */
19
  public $id;
20
+
21
  /**
22
  * Either "live" or "test". Indicates this being a test or a live (verified) customer.
23
  *
24
  * @var string
25
  */
26
  public $mode;
27
+
28
  /**
29
  * @var string
30
  */
31
  public $name;
32
+
33
  /**
34
  * @var string
35
  */
36
  public $email;
37
+
38
  /**
39
  * @var string|null
40
  */
41
  public $locale;
42
+
43
  /**
44
  * @var object|mixed|null
45
  */
46
  public $metadata;
47
+
48
  /**
49
  * @var string[]|array
50
  */
51
  public $recentlyUsedMethods;
52
+
53
  /**
54
  * @var string
55
  */
56
  public $createdAt;
57
+
58
  /**
59
  * @var object[]
60
  */
61
  public $_links;
62
+
63
  /**
64
  * @return Customer
65
  */
68
  if (!isset($this->_links->self->href)) {
69
  return $this;
70
  }
71
+
72
+ $body = json_encode(array(
73
+ "name" => $this->name,
74
+ "email" => $this->email,
75
+ "locale" => $this->locale,
76
+ "metadata" => $this->metadata,
77
+ ));
78
+
79
+ $result = $this->client->performHttpCallToFullUrl(MollieApiClient::HTTP_PATCH, $this->_links->self->href, $body);
80
+
81
+ return ResourceFactory::createFromApiResult($result, new Customer($this->client));
82
  }
83
+
84
  /**
85
  * @param array $options
86
  * @param array $filters
91
  {
92
  return $this->client->customerPayments->createFor($this, $options, $filters);
93
  }
94
+
95
  /**
96
  * Get all payments for this customer
97
  *
101
  {
102
  return $this->client->customerPayments->listFor($this, null, null, $this->getPresetOptions());
103
  }
104
+
105
  /**
106
  * @param array $options
107
  * @param array $filters
112
  {
113
  return $this->client->subscriptions->createFor($this, $options, $filters);
114
  }
115
+
116
  /**
117
  * @param string $subscriptionId
118
  * @param array $parameters
123
  {
124
  return $this->client->subscriptions->getFor($this, $subscriptionId, $parameters);
125
  }
126
+
127
  /**
128
  * @param string $subscriptionId
129
  *
133
  {
134
  return $this->client->subscriptions->cancelFor($this, $subscriptionId);
135
  }
136
+
137
  /**
138
  * Get all subscriptions for this customer
139
  *
143
  {
144
  return $this->client->subscriptions->listFor($this, null, null, $this->getPresetOptions());
145
  }
146
+
147
  /**
148
  * @param array $options
149
  * @param array $filters
154
  {
155
  return $this->client->mandates->createFor($this, $options, $filters);
156
  }
157
+
158
  /**
159
  * @param string $mandateId
160
  * @param array $parameters
165
  {
166
  return $this->client->mandates->getFor($this, $mandateId, $parameters);
167
  }
168
+
169
  /**
170
  * @param string $mandateId
171
  *
175
  {
176
  return $this->client->mandates->revokeFor($this, $mandateId);
177
  }
178
+
179
  /**
180
  * Get all mandates for this customer
181
  *
185
  {
186
  return $this->client->mandates->listFor($this, null, null, $this->getPresetOptions());
187
  }
188
+
189
  /**
190
  * Helper function to check for mandate with status valid
191
  *
196
  $mandates = $this->client->mandates->listFor($this, null, null, $this->getPresetOptions());
197
  foreach ($mandates as $mandate) {
198
  if ($mandate->isValid()) {
199
+ return true;
200
  }
201
  }
202
+
203
+ return false;
204
  }
205
+
206
  /**
207
  * When accessed by oAuth we want to pass the testmode by default
208
  *
211
  private function getPresetOptions()
212
  {
213
  $options = [];
214
+ if($this->client->usesOAuth()) {
215
+ $options["testmode"] = $this->mode === "test" ? true : false;
216
  }
217
+
218
  return $options;
219
  }
220
+ }
includes/mollie-api-php/src/Resources/CustomerCollection.php CHANGED
@@ -2,7 +2,7 @@
2
 
3
  namespace Mollie\Api\Resources;
4
 
5
- class CustomerCollection extends \Mollie\Api\Resources\CursorCollection
6
  {
7
  /**
8
  * @return string
@@ -11,11 +11,12 @@ class CustomerCollection extends \Mollie\Api\Resources\CursorCollection
11
  {
12
  return "customers";
13
  }
 
14
  /**
15
  * @return BaseResource
16
  */
17
  protected function createResourceObject()
18
  {
19
- return new \Mollie\Api\Resources\Customer($this->client);
20
  }
21
- }
2
 
3
  namespace Mollie\Api\Resources;
4
 
5
+ class CustomerCollection extends CursorCollection
6
  {
7
  /**
8
  * @return string
11
  {
12
  return "customers";
13
  }
14
+
15
  /**
16
  * @return BaseResource
17
  */
18
  protected function createResourceObject()
19
  {
20
+ return new Customer($this->client);
21
  }
22
+ }
includes/mollie-api-php/src/Resources/Invoice.php CHANGED
@@ -3,64 +3,76 @@
3
  namespace Mollie\Api\Resources;
4
 
5
  use Mollie\Api\Types\InvoiceStatus;
6
- class Invoice extends \Mollie\Api\Resources\BaseResource
 
7
  {
8
  /**
9
  * @var string
10
  */
11
  public $resource;
 
12
  /**
13
  * @var string
14
  */
15
  public $id;
 
16
  /**
17
  * @var string
18
  */
19
  public $reference;
 
20
  /**
21
  * @var string
22
  */
23
  public $vatNumber;
 
24
  /**
25
  * @var string
26
  */
27
  public $status;
 
28
  /**
29
  * Date the invoice was issued, e.g. 2018-01-01
30
  *
31
  * @var string
32
  */
33
  public $issuedAt;
 
34
  /**
35
  * Date the invoice was paid, e.g. 2018-01-01
36
  *
37
  * @var string|null
38
  */
39
  public $paidAt;
 
40
  /**
41
  * Date the invoice is due, e.g. 2018-01-01
42
  *
43
  * @var string|null
44
  */
45
  public $dueAt;
 
46
  /**
47
  * Amount object containing the total amount of the invoice excluding VAT.
48
  *
49
  * @var object
50
  */
51
  public $netAmount;
 
52
  /**
53
  * Amount object containing the VAT amount of the invoice. Only for merchants registered in the Netherlands.
54
  *
55
  * @var object
56
  */
57
  public $vatAmount;
 
58
  /**
59
  * Total amount of the invoice including VAT.
60
  *
61
  * @var object
62
  */
63
  public $grossAmount;
 
64
  /**
65
  * Object containing the invoice lines.
66
  * See https://docs.mollie.com/reference/v2/invoices-api/get-invoice for reference
@@ -68,31 +80,35 @@ class Invoice extends \Mollie\Api\Resources\BaseResource
68
  * @var object
69
  */
70
  public $lines;
 
71
  /**
72
  * Contains a PDF to the Invoice
73
  *
74
  * @var object[]
75
  */
76
  public $_links;
 
77
  /**
78
  * @return bool
79
  */
80
  public function isPaid()
81
  {
82
- return $this->status == \Mollie\Api\Types\InvoiceStatus::STATUS_PAID;
83
  }
 
84
  /**
85
  * @return bool
86
  */
87
  public function isOpen()
88
  {
89
- return $this->status == \Mollie\Api\Types\InvoiceStatus::STATUS_OPEN;
90
  }
 
91
  /**
92
  * @return bool
93
  */
94
  public function isOverdue()
95
  {
96
- return $this->status == \Mollie\Api\Types\InvoiceStatus::STATUS_OVERDUE;
97
  }
98
- }
3
  namespace Mollie\Api\Resources;
4
 
5
  use Mollie\Api\Types\InvoiceStatus;
6
+
7
+ class Invoice extends BaseResource
8
  {
9
  /**
10
  * @var string
11
  */
12
  public $resource;
13
+
14
  /**
15
  * @var string
16
  */
17
  public $id;
18
+
19
  /**
20
  * @var string
21
  */
22
  public $reference;
23
+
24
  /**
25
  * @var string
26
  */
27
  public $vatNumber;
28
+
29
  /**
30
  * @var string
31
  */
32
  public $status;
33
+
34
  /**
35
  * Date the invoice was issued, e.g. 2018-01-01
36
  *
37
  * @var string
38
  */
39
  public $issuedAt;
40
+
41
  /**
42
  * Date the invoice was paid, e.g. 2018-01-01
43
  *
44
  * @var string|null
45
  */
46
  public $paidAt;
47
+
48
  /**
49
  * Date the invoice is due, e.g. 2018-01-01
50
  *
51
  * @var string|null
52
  */
53
  public $dueAt;
54
+
55
  /**
56
  * Amount object containing the total amount of the invoice excluding VAT.
57
  *
58
  * @var object
59
  */
60
  public $netAmount;
61
+
62
  /**
63
  * Amount object containing the VAT amount of the invoice. Only for merchants registered in the Netherlands.
64
  *
65
  * @var object
66
  */
67
  public $vatAmount;
68
+
69
  /**
70
  * Total amount of the invoice including VAT.
71
  *
72
  * @var object
73
  */
74
  public $grossAmount;
75
+
76
  /**
77
  * Object containing the invoice lines.
78
  * See https://docs.mollie.com/reference/v2/invoices-api/get-invoice for reference
80
  * @var object
81
  */
82
  public $lines;
83
+
84
  /**
85
  * Contains a PDF to the Invoice
86
  *
87
  * @var object[]
88
  */
89
  public $_links;
90
+
91
  /**
92
  * @return bool
93
  */
94
  public function isPaid()
95
  {
96
+ return $this->status == InvoiceStatus::STATUS_PAID;
97
  }
98
+
99
  /**
100
  * @return bool
101
  */
102
  public function isOpen()
103
  {
104
+ return $this->status == InvoiceStatus::STATUS_OPEN;
105
  }
106
+
107
  /**
108
  * @return bool
109
  */
110
  public function isOverdue()
111
  {
112
+ return $this->status == InvoiceStatus::STATUS_OVERDUE;
113
  }
114
+ }
includes/mollie-api-php/src/Resources/InvoiceCollection.php CHANGED
@@ -2,7 +2,7 @@
2
 
3
  namespace Mollie\Api\Resources;
4
 
5
- class InvoiceCollection extends \Mollie\Api\Resources\CursorCollection
6
  {
7
  /**
8
  * @return string
@@ -11,11 +11,12 @@ class InvoiceCollection extends \Mollie\Api\Resources\CursorCollection
11
  {
12
  return "invoices";
13
  }
 
14
  /**
15
  * @return BaseResource
16
  */
17
  protected function createResourceObject()
18
  {
19
- return new \Mollie\Api\Resources\Invoice($this->client);
20
  }
21
- }
2
 
3
  namespace Mollie\Api\Resources;
4
 
5
+ class InvoiceCollection extends CursorCollection
6
  {
7
  /**
8
  * @return string
11
  {
12
  return "invoices";
13
  }
14
+
15
  /**
16
  * @return BaseResource
17
  */
18
  protected function createResourceObject()
19
  {
20
+ return new Invoice($this->client);
21
  }
22
+ }
includes/mollie-api-php/src/Resources/Issuer.php CHANGED
@@ -2,7 +2,7 @@
2
 
3
  namespace Mollie\Api\Resources;
4
 
5
- class Issuer extends \Mollie\Api\Resources\BaseResource
6
  {
7
  /**
8
  * Id of the issuer.
@@ -10,12 +10,14 @@ class Issuer extends \Mollie\Api\Resources\BaseResource
10
  * @var string
11
  */
12
  public $id;
 
13
  /**
14
  * Name of the issuer.
15
  *
16
  * @var string
17
  */
18
  public $name;
 
19
  /**
20
  * The payment method this issuer belongs to.
21
  *
@@ -23,10 +25,11 @@ class Issuer extends \Mollie\Api\Resources\BaseResource
23
  * @var string
24
  */
25
  public $method;
 
26
  /**
27
  * Object containing a size1x or size2x image
28
  *
29
  * @var object
30
  */
31
  public $image;
32
- }
2
 
3
  namespace Mollie\Api\Resources;
4
 
5
+ class Issuer extends BaseResource
6
  {
7
  /**
8
  * Id of the issuer.
10
  * @var string
11
  */
12
  public $id;
13
+
14
  /**
15
  * Name of the issuer.
16
  *
17
  * @var string
18
  */
19
  public $name;
20
+
21
  /**
22
  * The payment method this issuer belongs to.
23
  *
25
  * @var string
26
  */
27
  public $method;
28
+
29
  /**
30
  * Object containing a size1x or size2x image
31
  *
32
  * @var object
33
  */
34
  public $image;
35
+ }
includes/mollie-api-php/src/Resources/IssuerCollection.php CHANGED
@@ -2,7 +2,7 @@
2
 
3
  namespace Mollie\Api\Resources;
4
 
5
- class IssuerCollection extends \Mollie\Api\Resources\BaseCollection
6
  {
7
  /**
8
  * @return string|null
@@ -11,4 +11,4 @@ class IssuerCollection extends \Mollie\Api\Resources\BaseCollection
11
  {
12
  return null;
13
  }
14
- }
2
 
3
  namespace Mollie\Api\Resources;
4
 
5
+ class IssuerCollection extends BaseCollection
6
  {
7
  /**
8
  * @return string|null
11
  {
12
  return null;
13
  }
14
+ }
includes/mollie-api-php/src/Resources/Mandate.php CHANGED
@@ -4,71 +4,85 @@ namespace Mollie\Api\Resources;
4
 
5
  use Mollie\Api\MollieApiClient;
6
  use Mollie\Api\Types\MandateStatus;
7
- class Mandate extends \Mollie\Api\Resources\BaseResource
 
8
  {
9
  /**
10
  * @var string
11
  */
12
  public $resource;
 
13
  /**
14
  * @var string
15
  */
16
  public $id;
 
17
  /**
18
  * @var string
19
  */
20
  public $status;
 
21
  /**
22
  * @var string
23
  */
24
  public $method;
 
25
  /**
26
  * @var object|null
27
  */
28
  public $details;
 
29
  /**
30
  * @var string
31
  */
32
  public $customerId;
 
33
  /**
34
  * @var string
35
  */
36
  public $createdAt;
 
37
  /**
38
  * @var string
39
  */
40
  public $mandateReference;
 
41
  /**
42
  * Date of signature, for example: 2018-05-07
43
  *
44
  * @var string
45
  */
46
  public $signatureDate;
 
47
  /**
48
  * @var object
49
  */
50
  public $_links;
 
51
  /**
52
  * @return bool
53
  */
54
  public function isValid()
55
  {
56
- return $this->status === \Mollie\Api\Types\MandateStatus::STATUS_VALID;
57
  }
 
58
  /**
59
  * @return bool
60
  */
61
  public function isPending()
62
  {
63
- return $this->status === \Mollie\Api\Types\MandateStatus::STATUS_PENDING;
64
  }
 
65
  /**
66
  * @return bool
67
  */
68
  public function isInvalid()
69
  {
70
- return $this->status === \Mollie\Api\Types\MandateStatus::STATUS_INVALID;
71
  }
 
72
  /**
73
  * Revoke the mandate
74
  *
@@ -79,7 +93,10 @@ class Mandate extends \Mollie\Api\Resources\BaseResource
79
  if (!isset($this->_links->self->href)) {
80
  return $this;
81
  }
82
- $result = $this->client->performHttpCallToFullUrl(\Mollie\Api\MollieApiClient::HTTP_DELETE, $this->_links->self->href);
 
 
83
  return $result;
84
  }
85
- }
 
4
 
5
  use Mollie\Api\MollieApiClient;
6
  use Mollie\Api\Types\MandateStatus;
7
+
8
+ class Mandate extends BaseResource
9
  {
10
  /**
11
  * @var string
12
  */
13
  public $resource;
14
+
15
  /**
16
  * @var string
17
  */
18
  public $id;
19
+
20
  /**
21
  * @var string
22
  */
23
  public $status;
24
+
25
  /**
26
  * @var string
27
  */
28
  public $method;
29
+
30
  /**
31
  * @var object|null
32
  */
33
  public $details;
34
+
35
  /**
36
  * @var string
37
  */
38
  public $customerId;
39
+
40
  /**
41
  * @var string
42
  */
43
  public $createdAt;
44
+
45
  /**
46
  * @var string
47
  */
48
  public $mandateReference;
49
+
50
  /**
51
  * Date of signature, for example: 2018-05-07
52
  *
53
  * @var string
54
  */
55
  public $signatureDate;
56
+
57
  /**
58
  * @var object
59
  */
60
  public $_links;
61
+
62
  /**
63
  * @return bool
64
  */
65
  public function isValid()
66
  {
67
+ return $this->status === MandateStatus::STATUS_VALID;
68
  }
69
+
70
  /**
71
  * @return bool
72
  */
73
  public function isPending()
74
  {
75
+ return $this->status === MandateStatus::STATUS_PENDING;
76
  }
77
+
78
  /**
79
  * @return bool
80
  */
81
  public function isInvalid()
82
  {
83
+ return $this->status === MandateStatus::STATUS_INVALID;
84
  }
85
+
86
  /**
87
  * Revoke the mandate
88
  *
93
  if (!isset($this->_links->self->href)) {
94
  return $this;
95
  }
96
+
97
+ $result = $this->client->performHttpCallToFullUrl(MollieApiClient::HTTP_DELETE, $this->_links->self->href);
98
+
99
  return $result;
100
  }
101
+
102
+ }
includes/mollie-api-php/src/Resources/MandateCollection.php CHANGED
@@ -2,7 +2,7 @@
2
 
3
  namespace Mollie\Api\Resources;
4
 
5
- class MandateCollection extends \Mollie\Api\Resources\CursorCollection
6
  {
7
  /**
8
  * @return string
@@ -11,11 +11,12 @@ class MandateCollection extends \Mollie\Api\Resources\CursorCollection
11
  {
12
  return "mandates";
13
  }
 
14
  /**
15
  * @return BaseResource
16
  */
17
  protected function createResourceObject()
18
  {
19
- return new \Mollie\Api\Resources\Mandate($this->client);
20
  }
21
- }
2
 
3
  namespace Mollie\Api\Resources;
4
 
5
+ class MandateCollection extends CursorCollection
6
  {
7
  /**
8
  * @return string
11
  {
12
  return "mandates";
13
  }
14
+
15
  /**
16
  * @return BaseResource
17
  */
18
  protected function createResourceObject()
19
  {
20
+ return new Mandate($this->client);
21
  }
22
+ }
includes/mollie-api-php/src/Resources/Method.php CHANGED
@@ -2,7 +2,7 @@
2
 
3
  namespace Mollie\Api\Resources;
4
 
5
- class Method extends \Mollie\Api\Resources\BaseResource
6
  {
7
  /**
8
  * Id of the payment method.
@@ -10,18 +10,21 @@ class Method extends \Mollie\Api\Resources\BaseResource
10
  * @var string
11
  */
12
  public $id;
 
13
  /**
14
  * More legible description of the payment method.
15
  *
16
  * @var string
17
  */
18
  public $description;
 
19
  /**
20
  * The $image->size1x and $image->size2x to display the payment method logo.
21
  *
22
  * @var object
23
  */
24
  public $image;
 
25
  /**
26
  * The issuers available for this payment method. Only for the methods iDEAL, KBC/CBC and gift cards.
27
  * Will only be filled when explicitly requested using the query string `include` parameter.
@@ -29,10 +32,12 @@ class Method extends \Mollie\Api\Resources\BaseResource
29
  * @var array|object[]
30
  */
31
  public $issuers;
 
32
  /**
33
  * @var object[]
34
  */
35
  public $_links;
 
36
  /**
37
  * Get the issuer value objects
38
  *
@@ -40,10 +45,11 @@ class Method extends \Mollie\Api\Resources\BaseResource
40
  */
41
  public function issuers()
42
  {
43
- $issuers = new \Mollie\Api\Resources\IssuerCollection(\count($this->issuers), null);
44
  foreach ($this->issuers as $issuer) {
45
- $issuers->append(\Mollie\Api\Resources\ResourceFactory::createFromApiResult($issuer, new \Mollie\Api\Resources\Issuer($this->client)));
46
  }
 
47
  return $issuers;
48
  }
49
  }
2
 
3
  namespace Mollie\Api\Resources;
4
 
5
+ class Method extends BaseResource
6
  {
7
  /**
8
  * Id of the payment method.
10
  * @var string
11
  */
12
  public $id;
13
+
14
  /**
15
  * More legible description of the payment method.
16
  *
17
  * @var string
18
  */
19
  public $description;
20
+
21
  /**
22
  * The $image->size1x and $image->size2x to display the payment method logo.
23
  *
24
  * @var object
25
  */
26
  public $image;
27
+
28
  /**
29
  * The issuers available for this payment method. Only for the methods iDEAL, KBC/CBC and gift cards.
30
  * Will only be filled when explicitly requested using the query string `include` parameter.
32
  * @var array|object[]
33
  */
34
  public $issuers;
35
+
36
  /**
37
  * @var object[]
38
  */
39
  public $_links;
40
+
41
  /**
42
  * Get the issuer value objects
43
  *
45
  */
46
  public function issuers()
47
  {
48
+ $issuers = new IssuerCollection(count($this->issuers), null);
49
  foreach ($this->issuers as $issuer) {
50
+ $issuers->append(ResourceFactory::createFromApiResult($issuer, new Issuer($this->client)));
51
  }
52
+
53
  return $issuers;
54
  }
55
  }
includes/mollie-api-php/src/Resources/MethodCollection.php CHANGED
@@ -2,7 +2,7 @@
2
 
3
  namespace Mollie\Api\Resources;
4
 
5
- class MethodCollection extends \Mollie\Api\Resources\BaseCollection
6
  {
7
  /**
8
  * @return string
2
 
3
  namespace Mollie\Api\Resources;
4
 
5
+ class MethodCollection extends BaseCollection
6
  {
7
  /**
8
  * @return string
includes/mollie-api-php/src/Resources/Payment.php CHANGED
@@ -6,36 +6,42 @@ use Mollie\Api\Exceptions\ApiException;
6
  use Mollie\Api\MollieApiClient;
7
  use Mollie\Api\Types\PaymentStatus;
8
  use Mollie\Api\Types\SequenceType;
9
- class Payment extends \Mollie\Api\Resources\BaseResource
 
10
  {
11
  /**
12
  * @var string
13
  */
14
  public $resource;
 
15
  /**
16
  * Id of the payment (on the Mollie platform).
17
  *
18
  * @var string
19
  */
20
  public $id;
 
21
  /**
22
  * Mode of the payment, either "live" or "test" depending on the API Key that was used.
23
  *
24
  * @var string
25
  */
26
  public $mode;
 
27
  /**
28
  * Amount object containing the value and currency
29
  *
30
  * @var object
31
  */
32
  public $amount;
 
33
  /**
34
  * The amount that has been settled containing the value and currency
35
  *
36
  * @var object
37
  */
38
  public $settlementAmount;
 
39
  /**
40
  * The amount of the payment that has been refunded to the consumer, in EURO with 2 decimals. This field will be
41
  * null if the payment can not be refunded.
@@ -43,6 +49,7 @@ class Payment extends \Mollie\Api\Resources\BaseResource
43
  * @var object|null
44
  */
45
  public $amountRefunded;
 
46
  /**
47
  * The amount of a refunded payment that can still be refunded, in EURO with 2 decimals. This field will be
48
  * null if the payment can not be refunded.
@@ -53,6 +60,7 @@ class Payment extends \Mollie\Api\Resources\BaseResource
53
  * @var object|null
54
  */
55
  public $amountRemaining;
 
56
  /**
57
  * Description of the payment that is shown to the customer during the payment, and
58
  * possibly on the bank or credit card statement.
@@ -60,6 +68,7 @@ class Payment extends \Mollie\Api\Resources\BaseResource
60
  * @var string
61
  */
62
  public $description;
 
63
  /**
64
  * If method is empty/null, the customer can pick his/her preferred payment method.
65
  *
@@ -67,12 +76,14 @@ class Payment extends \Mollie\Api\Resources\BaseResource
67
  * @var string|null
68
  */
69
  public $method;
 
70
  /**
71
  * The status of the payment.
72
  *
73
  * @var string
74
  */
75
- public $status = \Mollie\Api\Types\PaymentStatus::STATUS_OPEN;
 
76
  /**
77
  * UTC datetime the payment was created in ISO-8601 format.
78
  *
@@ -80,6 +91,7 @@ class Payment extends \Mollie\Api\Resources\BaseResource
80
  * @var string|null
81
  */
82
  public $createdAt;
 
83
  /**
84
  * UTC datetime the payment was paid in ISO-8601 format.
85
  *
@@ -87,6 +99,7 @@ class Payment extends \Mollie\Api\Resources\BaseResource
87
  * @var string|null
88
  */
89
  public $paidAt;
 
90
  /**
91
  * UTC datetime the payment was canceled in ISO-8601 format.
92
  *
@@ -94,18 +107,21 @@ class Payment extends \Mollie\Api\Resources\BaseResource
94
  * @var string|null
95
  */
96
  public $canceledAt;
 
97
  /**
98
  * UTC datetime the payment expired in ISO-8601 format.
99
  *
100
  * @var string|null
101
  */
102
  public $expiresAt;
 
103
  /**
104
  * UTC datetime the payment failed in ISO-8601 format.
105
  *
106
  * @var string|null
107
  */
108
  public $failedAt;
 
109
  /**
110
  * The profile ID this payment belongs to.
111
  *
@@ -113,24 +129,28 @@ class Payment extends \Mollie\Api\Resources\BaseResource
113
  * @var string
114
  */
115
  public $profileId;
 
116
  /**
117
  * Either "first", "recurring", or "oneoff" for regular payments.
118
  *
119
  * @var string|null
120
  */
121
  public $sequenceType;
 
122
  /**
123
  * Redirect URL set on this payment
124
  *
125
  * @var string
126
  */
127
  public $redirectUrl;
 
128
  /**
129
  * Webhook URL set on this payment
130
  *
131
  * @var string
132
  */
133
  public $webhookUrl;
 
134
  /**
135
  * The mandate ID this payment is performed with.
136
  *
@@ -138,6 +158,7 @@ class Payment extends \Mollie\Api\Resources\BaseResource
138
  * @var string|null
139
  */
140
  public $mandateId;
 
141
  /**
142
  * The subscription ID this payment belongs to.
143
  *
@@ -145,6 +166,7 @@ class Payment extends \Mollie\Api\Resources\BaseResource
145
  * @var string|null
146
  */
147
  public $subscriptionId;
 
148
  /**
149
  * The settlement ID this payment belongs to.
150
  *
@@ -152,12 +174,14 @@ class Payment extends \Mollie\Api\Resources\BaseResource
152
  * @var string|null
153
  */
154
  public $settlementId;
 
155
  /**
156
  * The locale used for this payment.
157
  *
158
  * @var string|null
159
  */
160
  public $locale;
 
161
  /**
162
  * During creation of the payment you can set custom metadata that is stored with
163
  * the payment, and given back whenever you retrieve that payment.
@@ -165,6 +189,7 @@ class Payment extends \Mollie\Api\Resources\BaseResource
165
  * @var object|mixed|null
166
  */
167
  public $metadata;
 
168
  /**
169
  * Details of a successfully paid payment are set here. For example, the iDEAL
170
  * payment method will set $details->consumerName and $details->consumerAccount.
@@ -172,16 +197,19 @@ class Payment extends \Mollie\Api\Resources\BaseResource
172
  * @var object
173
  */
174
  public $details;
 
175
  /**
176
  * @var object[]
177
  */
178
  public $_links;
 
179
  /**
180
  * Whether or not this payment can be canceled.
181
  *
182
  * @var bool|null
183
  */
184
  public $isCancelable;
 
185
  /**
186
  * Is this payment canceled?
187
  *
@@ -189,8 +217,9 @@ class Payment extends \Mollie\Api\Resources\BaseResource
189
  */
190
  public function isCanceled()
191
  {
192
- return $this->status === \Mollie\Api\Types\PaymentStatus::STATUS_CANCELED;
193
  }
 
194
  /**
195
  * Is this payment expired?
196
  *
@@ -198,8 +227,9 @@ class Payment extends \Mollie\Api\Resources\BaseResource
198
  */
199
  public function isExpired()
200
  {
201
- return $this->status === \Mollie\Api\Types\PaymentStatus::STATUS_EXPIRED;
202
  }
 
203
  /**
204
  * Is this payment still open / ongoing?
205
  *
@@ -207,8 +237,9 @@ class Payment extends \Mollie\Api\Resources\BaseResource
207
  */
208
  public function isOpen()
209
  {
210
- return $this->status === \Mollie\Api\Types\PaymentStatus::STATUS_OPEN;
211
  }
 
212
  /**
213
  * Is this payment pending?
214
  *
@@ -216,8 +247,9 @@ class Payment extends \Mollie\Api\Resources\BaseResource
216
  */
217
  public function isPending()
218
  {
219
- return $this->status === \Mollie\Api\Types\PaymentStatus::STATUS_PENDING;
220
  }
 
221
  /**
222
  * Is this payment paid for?
223
  *
@@ -227,6 +259,7 @@ class Payment extends \Mollie\Api\Resources\BaseResource
227
  {
228
  return !empty($this->paidAt);
229
  }
 
230
  /**
231
  * Does the payment have refunds
232
  *
@@ -236,6 +269,7 @@ class Payment extends \Mollie\Api\Resources\BaseResource
236
  {
237
  return !empty($this->_links->refunds);
238
  }
 
239
  /**
240
  * Does this payment has chargebacks
241
  *
@@ -245,6 +279,7 @@ class Payment extends \Mollie\Api\Resources\BaseResource
245
  {
246
  return !empty($this->_links->chargebacks);
247
  }
 
248
  /**
249
  * Is this payment failing?
250
  *
@@ -252,8 +287,9 @@ class Payment extends \Mollie\Api\Resources\BaseResource
252
  */
253
  public function isFailed()
254
  {
255
- return $this->status === \Mollie\Api\Types\PaymentStatus::STATUS_FAILED;
256
  }
 
257
  /**
258
  * Check whether 'sequenceType' is set to 'first'. If a 'first' payment has been completed successfully, the
259
  * consumer's account may be charged automatically using recurring payments.
@@ -262,8 +298,9 @@ class Payment extends \Mollie\Api\Resources\BaseResource
262
  */
263
  public function hasSequenceTypeFirst()
264
  {
265
- return $this->sequenceType === \Mollie\Api\Types\SequenceType::SEQUENCETYPE_FIRST;
266
  }
 
267
  /**
268
  * Check whether 'sequenceType' is set to 'recurring'. This type of payment is processed without involving
269
  * the consumer.
@@ -272,8 +309,9 @@ class Payment extends \Mollie\Api\Resources\BaseResource
272
  */
273
  public function hasSequenceTypeRecurring()
274
  {
275
- return $this->sequenceType === \Mollie\Api\Types\SequenceType::SEQUENCETYPE_RECURRING;
276
  }
 
277
  /**
278
  * Get the checkout URL where the customer can complete the payment.
279
  *
@@ -284,8 +322,10 @@ class Payment extends \Mollie\Api\Resources\BaseResource
284
  if (empty($this->_links->checkout)) {
285
  return null;
286
  }
 
287
  return $this->_links->checkout->href;
288
  }
 
289
  /**
290
  * @return bool
291
  */
@@ -293,6 +333,7 @@ class Payment extends \Mollie\Api\Resources\BaseResource
293
  {
294
  return $this->amountRemaining !== null;
295
  }
 
296
  /**
297
  * @return bool
298
  */
@@ -300,6 +341,7 @@ class Payment extends \Mollie\Api\Resources\BaseResource
300
  {
301
  return $this->canBeRefunded();
302
  }
 
303
  /**
304
  * Get the amount that is already refunded
305
  *
@@ -308,10 +350,12 @@ class Payment extends \Mollie\Api\Resources\BaseResource
308
  public function getAmountRefunded()
309
  {
310
  if ($this->amountRefunded) {
311
- return (double) $this->amountRefunded->value;
312
  }
 
313
  return 0.0;
314
  }
 
315
  /**
316
  * Get the remaining amount that can be refunded. For some payment methods this amount can be higher than
317
  * the payment amount. This is possible to reimburse the costs for a return shipment to your customer for example.
@@ -321,10 +365,12 @@ class Payment extends \Mollie\Api\Resources\BaseResource
321
  public function getAmountRemaining()
322
  {
323
  if ($this->amountRemaining) {
324
- return (double) $this->amountRemaining->value;
325
  }
 
326
  return 0.0;
327
  }
 
328
  /**
329
  * Retrieves all refunds associated with this payment
330
  *
@@ -334,15 +380,19 @@ class Payment extends \Mollie\Api\Resources\BaseResource
334
  public function refunds()
335
  {
336
  if (!isset($this->_links->refunds->href)) {
337
- return new \Mollie\Api\Resources\RefundCollection($this->client, 0, null);
338
  }
339
- $result = $this->client->performHttpCallToFullUrl(\Mollie\Api\MollieApiClient::HTTP_GET, $this->_links->refunds->href);
340
- $resourceCollection = new \Mollie\Api\Resources\RefundCollection($this->client, $result->count, $result->_links);
 
 
341
  foreach ($result->_embedded->refunds as $dataResult) {
342
- $resourceCollection[] = \Mollie\Api\Resources\ResourceFactory::createFromApiResult($dataResult, new \Mollie\Api\Resources\Refund($this->client));
343
  }
 
344
  return $resourceCollection;
345
  }
 
346
  /**
347
  * @param string $refundId
348
  * @param array $parameters
@@ -353,6 +403,7 @@ class Payment extends \Mollie\Api\Resources\BaseResource
353
  {
354
  return $this->client->paymentRefunds->getFor($this, $refundId, $parameters);
355
  }
 
356
  /**
357
  * Retrieves all chargebacks associated with this payment
358
  *
@@ -362,15 +413,19 @@ class Payment extends \Mollie\Api\Resources\BaseResource
362
  public function chargebacks()
363
  {
364
  if (!isset($this->_links->chargebacks->href)) {
365
- return new \Mollie\Api\Resources\ChargebackCollection($this->client, 0, null);
366
  }
367
- $result = $this->client->performHttpCallToFullUrl(\Mollie\Api\MollieApiClient::HTTP_GET, $this->_links->chargebacks->href);
368
- $resourceCollection = new \Mollie\Api\Resources\ChargebackCollection($this->client, $result->count, $result->_links);
 
 
369
  foreach ($result->_embedded->chargebacks as $dataResult) {
370
- $resourceCollection[] = \Mollie\Api\Resources\ResourceFactory::createFromApiResult($dataResult, new \Mollie\Api\Resources\Chargeback($this->client));
371
  }
 
372
  return $resourceCollection;
373
  }
 
374
  /**
375
  * Issue a refund for this payment.
376
  *
@@ -383,12 +438,15 @@ class Payment extends \Mollie\Api\Resources\BaseResource
383
  */
384
  public function refund($data = [])
385
  {
386
- $resource = "payments/" . \urlencode($this->id) . "/refunds";
 
387
  $body = null;
388
- if (\count($data) > 0) {
389
- $body = \json_encode($data);
390
  }
391
- $result = $this->client->performHttpCall(\Mollie\Api\MollieApiClient::HTTP_POST, $resource, $body);
392
- return \Mollie\Api\Resources\ResourceFactory::createFromApiResult($result, new \Mollie\Api\Resources\Refund($this->client));
 
 
393
  }
394
  }
6
  use Mollie\Api\MollieApiClient;
7
  use Mollie\Api\Types\PaymentStatus;
8
  use Mollie\Api\Types\SequenceType;
9
+
10
+ class Payment extends BaseResource
11
  {
12
  /**
13
  * @var string
14
  */
15
  public $resource;
16
+
17
  /**
18
  * Id of the payment (on the Mollie platform).
19
  *
20
  * @var string
21
  */
22
  public $id;
23
+
24
  /**
25
  * Mode of the payment, either "live" or "test" depending on the API Key that was used.
26
  *
27
  * @var string
28
  */
29
  public $mode;
30
+
31
  /**
32
  * Amount object containing the value and currency
33
  *
34
  * @var object
35
  */
36
  public $amount;
37
+
38
  /**
39
  * The amount that has been settled containing the value and currency
40
  *
41
  * @var object
42
  */
43
  public $settlementAmount;
44
+
45
  /**
46
  * The amount of the payment that has been refunded to the consumer, in EURO with 2 decimals. This field will be
47
  * null if the payment can not be refunded.
49
  * @var object|null
50
  */
51
  public $amountRefunded;
52
+
53
  /**
54
  * The amount of a refunded payment that can still be refunded, in EURO with 2 decimals. This field will be
55
  * null if the payment can not be refunded.
60
  * @var object|null
61
  */
62
  public $amountRemaining;
63
+
64
  /**
65
  * Description of the payment that is shown to the customer during the payment, and
66
  * possibly on the bank or credit card statement.
68
  * @var string
69
  */
70
  public $description;
71
+
72
  /**
73
  * If method is empty/null, the customer can pick his/her preferred payment method.
74
  *
76
  * @var string|null
77
  */
78
  public $method;
79
+
80
  /**
81
  * The status of the payment.
82
  *
83
  * @var string
84
  */
85
+ public $status = PaymentStatus::STATUS_OPEN;
86
+
87
  /**
88
  * UTC datetime the payment was created in ISO-8601 format.
89
  *
91
  * @var string|null
92
  */
93
  public $createdAt;
94
+
95
  /**
96
  * UTC datetime the payment was paid in ISO-8601 format.
97
  *
99
  * @var string|null
100
  */
101
  public $paidAt;
102
+
103
  /**
104
  * UTC datetime the payment was canceled in ISO-8601 format.
105
  *
107
  * @var string|null
108
  */
109
  public $canceledAt;
110
+
111
  /**
112
  * UTC datetime the payment expired in ISO-8601 format.
113
  *
114
  * @var string|null
115
  */
116
  public $expiresAt;
117
+
118
  /**
119
  * UTC datetime the payment failed in ISO-8601 format.
120
  *
121
  * @var string|null
122
  */
123
  public $failedAt;
124
+
125
  /**
126
  * The profile ID this payment belongs to.
127
  *
129
  * @var string
130
  */
131
  public $profileId;
132
+
133
  /**
134
  * Either "first", "recurring", or "oneoff" for regular payments.
135
  *
136
  * @var string|null
137
  */
138
  public $sequenceType;
139
+
140
  /**
141
  * Redirect URL set on this payment
142
  *
143
  * @var string
144
  */
145
  public $redirectUrl;
146
+
147
  /**
148
  * Webhook URL set on this payment
149
  *
150
  * @var string
151
  */
152
  public $webhookUrl;
153
+
154
  /**
155
  * The mandate ID this payment is performed with.
156
  *
158
  * @var string|null
159
  */
160
  public $mandateId;
161
+
162
  /**
163
  * The subscription ID this payment belongs to.
164
  *
166
  * @var string|null
167
  */
168
  public $subscriptionId;
169
+
170
  /**
171
  * The settlement ID this payment belongs to.
172
  *
174
  * @var string|null
175
  */
176
  public $settlementId;
177
+
178
  /**
179
  * The locale used for this payment.
180
  *
181
  * @var string|null
182
  */
183
  public $locale;
184
+
185
  /**
186
  * During creation of the payment you can set custom metadata that is stored with
187
  * the payment, and given back whenever you retrieve that payment.
189
  * @var object|mixed|null
190
  */
191
  public $metadata;
192
+
193
  /**
194
  * Details of a successfully paid payment are set here. For example, the iDEAL
195
  * payment method will set $details->consumerName and $details->consumerAccount.
197
  * @var object
198
  */
199
  public $details;
200
+
201
  /**
202
  * @var object[]
203
  */
204
  public $_links;
205
+
206
  /**
207
  * Whether or not this payment can be canceled.
208
  *
209
  * @var bool|null
210
  */
211
  public $isCancelable;
212
+
213
  /**
214
  * Is this payment canceled?
215
  *
217
  */
218
  public function isCanceled()
219
  {
220
+ return $this->status === PaymentStatus::STATUS_CANCELED;
221
  }
222
+
223
  /**
224
  * Is this payment expired?
225
  *
227
  */
228
  public function isExpired()
229
  {
230
+ return $this->status === PaymentStatus::STATUS_EXPIRED;
231
  }
232
+
233
  /**
234
  * Is this payment still open / ongoing?
235
  *
237
  */
238
  public function isOpen()
239
  {
240
+ return $this->status === PaymentStatus::STATUS_OPEN;
241
  }
242
+
243
  /**
244
  * Is this payment pending?
245
  *
247
  */
248
  public function isPending()
249
  {
250
+ return $this->status === PaymentStatus::STATUS_PENDING;
251
  }
252
+
253
  /**
254
  * Is this payment paid for?
255
  *
259
  {
260
  return !empty($this->paidAt);
261
  }
262
+
263
  /**
264
  * Does the payment have refunds
265
  *
269
  {
270
  return !empty($this->_links->refunds);
271
  }
272
+
273
  /**
274
  * Does this payment has chargebacks
275
  *
279
  {
280
  return !empty($this->_links->chargebacks);
281
  }
282
+
283
  /**
284
  * Is this payment failing?
285
  *
287
  */
288
  public function isFailed()
289
  {
290
+ return $this->status === PaymentStatus::STATUS_FAILED;
291
  }
292
+
293
  /**
294
  * Check whether 'sequenceType' is set to 'first'. If a 'first' payment has been completed successfully, the
295
  * consumer's account may be charged automatically using recurring payments.
298
  */
299
  public function hasSequenceTypeFirst()
300
  {
301
+ return $this->sequenceType === SequenceType::SEQUENCETYPE_FIRST;
302
  }
303
+
304
  /**
305
  * Check whether 'sequenceType' is set to 'recurring'. This type of payment is processed without involving
306
  * the consumer.
309
  */
310
  public function hasSequenceTypeRecurring()
311
  {
312
+ return $this->sequenceType === SequenceType::SEQUENCETYPE_RECURRING;
313
  }
314
+
315
  /**
316
  * Get the checkout URL where the customer can complete the payment.
317
  *
322
  if (empty($this->_links->checkout)) {
323
  return null;
324
  }
325
+
326
  return $this->_links->checkout->href;
327
  }
328
+
329
  /**
330
  * @return bool
331
  */
333
  {
334
  return $this->amountRemaining !== null;
335
  }
336
+
337
  /**
338
  * @return bool
339
  */
341
  {
342
  return $this->canBeRefunded();
343
  }
344
+
345
  /**
346
  * Get the amount that is already refunded
347
  *
350
  public function getAmountRefunded()
351
  {
352
  if ($this->amountRefunded) {
353
+ return (float)$this->amountRefunded->value;
354
  }
355
+
356
  return 0.0;
357
  }
358
+
359
  /**
360
  * Get the remaining amount that can be refunded. For some payment methods this amount can be higher than
361
  * the payment amount. This is possible to reimburse the costs for a return shipment to your customer for example.
365
  public function getAmountRemaining()
366
  {
367
  if ($this->amountRemaining) {
368
+ return (float)$this->amountRemaining->value;
369
  }
370
+
371
  return 0.0;
372
  }
373
+
374
  /**
375
  * Retrieves all refunds associated with this payment
376
  *
380
  public function refunds()
381
  {
382
  if (!isset($this->_links->refunds->href)) {
383
+ return new RefundCollection($this->client, 0, null);
384
  }
385
+
386
+ $result = $this->client->performHttpCallToFullUrl(MollieApiClient::HTTP_GET, $this->_links->refunds->href);
387
+
388
+ $resourceCollection = new RefundCollection($this->client, $result->count, $result->_links);
389
  foreach ($result->_embedded->refunds as $dataResult) {
390
+ $resourceCollection[] = ResourceFactory::createFromApiResult($dataResult, new Refund($this->client));
391
  }
392
+
393
  return $resourceCollection;
394
  }
395
+
396
  /**
397
  * @param string $refundId
398
  * @param array $parameters
403
  {
404
  return $this->client->paymentRefunds->getFor($this, $refundId, $parameters);
405
  }
406
+
407
  /**
408
  * Retrieves all chargebacks associated with this payment
409
  *
413
  public function chargebacks()
414
  {
415
  if (!isset($this->_links->chargebacks->href)) {
416
+ return new ChargebackCollection($this->client, 0, null);
417
  }
418
+
419
+ $result = $this->client->performHttpCallToFullUrl(MollieApiClient::HTTP_GET, $this->_links->chargebacks->href);
420
+
421
+ $resourceCollection = new ChargebackCollection($this->client, $result->count, $result->_links);
422
  foreach ($result->_embedded->chargebacks as $dataResult) {
423
+ $resourceCollection[] = ResourceFactory::createFromApiResult($dataResult, new Chargeback($this->client));
424
  }
425
+
426
  return $resourceCollection;
427
  }
428
+
429
  /**
430
  * Issue a refund for this payment.
431
  *
438
  */
439
  public function refund($data = [])
440
  {
441
+ $resource = "payments/" . urlencode($this->id) . "/refunds";
442
+
443
  $body = null;
444
+ if (count($data) > 0) {
445
+ $body = json_encode($data);
446
  }
447
+
448
+ $result = $this->client->performHttpCall(MollieApiClient::HTTP_POST, $resource, $body);
449
+
450
+ return ResourceFactory::createFromApiResult($result, new Refund($this->client));
451
  }
452
  }
includes/mollie-api-php/src/Resources/PaymentCollection.php CHANGED
@@ -2,7 +2,7 @@
2
 
3
  namespace Mollie\Api\Resources;
4
 
5
- class PaymentCollection extends \Mollie\Api\Resources\CursorCollection
6
  {
7
  /**
8
  * @return string
@@ -11,11 +11,12 @@ class PaymentCollection extends \Mollie\Api\Resources\CursorCollection
11
  {
12
  return "payments";
13
  }
 
14
  /**
15
  * @return BaseResource
16
  */
17
  protected function createResourceObject()
18
  {
19
- return new \Mollie\Api\Resources\Payment($this->client);
20
  }
21
  }
2
 
3
  namespace Mollie\Api\Resources;
4
 
5
+ class PaymentCollection extends CursorCollection
6
  {
7
  /**
8
  * @return string
11
  {
12
  return "payments";
13
  }
14
+
15
  /**
16
  * @return BaseResource
17
  */
18
  protected function createResourceObject()
19
  {
20
+ return new Payment($this->client);
21
  }
22
  }
includes/mollie-api-php/src/Resources/Profile.php CHANGED
@@ -5,52 +5,63 @@ namespace Mollie\Api\Resources;
5
  use Mollie\Api\Exceptions\ApiException;
6
  use Mollie\Api\MollieApiClient;
7
  use Mollie\Api\Types\ProfileStatus;
8
- class Profile extends \Mollie\Api\Resources\BaseResource
 
9
  {
10
  /**
11
  * @var string
12
  */
13
  public $resource;
 
14
  /**
15
  * @var string
16
  */
17
  public $id;
 
18
  /**
19
  * Test or live mode
20
  *
21
  * @var string
22
  */
23
  public $mode;
 
24
  /**
25
  * @var string
26
  */
27
  public $name;
 
28
  /**
29
  * @var string
30
  */
31
  public $website;
 
32
  /**
33
  * @var string
34
  */
35
  public $email;
 
36
  /**
37
  * @var string
38
  */
39
  public $phone;
 
40
  /**
41
  * See https://docs.mollie.com/reference/v2/profiles-api/get-profile
42
  *
43
  * @var int
44
  */
45
  public $categoryCode;
 
46
  /**
47
  * @var string
48
  */
49
  public $status;
 
50
  /**
51
  * @var object
52
  */
53
  public $review;
 
54
  /**
55
  * UTC datetime the profile was created in ISO-8601 format.
56
  *
@@ -58,31 +69,36 @@ class Profile extends \Mollie\Api\Resources\BaseResource
58
  * @var string
59
  */
60
  public $createdAt;
 
61
  /**
62
  * @var object[]
63
  */
64
  public $_links;
 
65
  /**
66
  * @return bool
67
  */
68
  public function isUnverified()
69
  {
70
- return $this->status == \Mollie\Api\Types\ProfileStatus::STATUS_UNVERIFIED;
71
  }
 
72
  /**
73
  * @return bool
74
  */
75
  public function isVerified()
76
  {
77
- return $this->status == \Mollie\Api\Types\ProfileStatus::STATUS_VERIFIED;
78
  }
 
79
  /**
80
  * @return bool
81
  */
82
  public function isBlocked()
83
  {
84
- return $this->status == \Mollie\Api\Types\ProfileStatus::STATUS_BLOCKED;
85
  }
 
86
  /**
87
  * @return Profile
88
  */
@@ -91,10 +107,21 @@ class Profile extends \Mollie\Api\Resources\BaseResource
91
  if (!isset($this->_links->self->href)) {
92
  return $this;
93
  }
94
- $body = \json_encode(array("name" => $this->name, "website" => $this->website, "email" => $this->email, "phone" => $this->phone, "categoryCode" => $this->categoryCode, "mode" => $this->mode));
95
- $result = $this->client->performHttpCallToFullUrl(\Mollie\Api\MollieApiClient::HTTP_PATCH, $this->_links->self->href, $body);
96
- return \Mollie\Api\Resources\ResourceFactory::createFromApiResult($result, new \Mollie\Api\Resources\Profile($this->client));
 
 
 
 
 
 
 
 
 
 
97
  }
 
98
  /**
99
  * Retrieves all chargebacks associated with this profile
100
  *
@@ -104,15 +131,19 @@ class Profile extends \Mollie\Api\Resources\BaseResource
104
  public function chargebacks()
105
  {
106
  if (!isset($this->_links->chargebacks->href)) {
107
- return new \Mollie\Api\Resources\ChargebackCollection($this->client, 0, null);
108
  }
109
- $result = $this->client->performHttpCallToFullUrl(\Mollie\Api\MollieApiClient::HTTP_GET, $this->_links->chargebacks->href);
110
- $resourceCollection = new \Mollie\Api\Resources\ChargebackCollection($this->client, $result->count, $result->_links);
 
 
111
  foreach ($result->_embedded->chargebacks as $dataResult) {
112
- $resourceCollection[] = \Mollie\Api\Resources\ResourceFactory::createFromApiResult($dataResult, new \Mollie\Api\Resources\Chargeback($this->client));
113
  }
 
114
  return $resourceCollection;
115
  }
 
116
  /**
117
  * Retrieves all methods activated on this profile
118
  *
@@ -122,15 +153,19 @@ class Profile extends \Mollie\Api\Resources\BaseResource
122
  public function methods()
123
  {
124
  if (!isset($this->_links->methods->href)) {
125
- return new \Mollie\Api\Resources\MethodCollection(0, null);
126
  }
127
- $result = $this->client->performHttpCallToFullUrl(\Mollie\Api\MollieApiClient::HTTP_GET, $this->_links->methods->href);
128
- $resourceCollection = new \Mollie\Api\Resources\MethodCollection($result->count, $result->_links);
 
 
129
  foreach ($result->_embedded->methods as $dataResult) {
130
- $resourceCollection[] = \Mollie\Api\Resources\ResourceFactory::createFromApiResult($dataResult, new \Mollie\Api\Resources\Method($this->client));
131
  }
 
132
  return $resourceCollection;
133
  }
 
134
  /**
135
  * Retrieves all payments associated with this profile
136
  *
@@ -140,15 +175,19 @@ class Profile extends \Mollie\Api\Resources\BaseResource
140
  public function payments()
141
  {
142
  if (!isset($this->_links->payments->href)) {
143
- return new \Mollie\Api\Resources\PaymentCollection($this->client, 0, null);
144
  }
145
- $result = $this->client->performHttpCallToFullUrl(\Mollie\Api\MollieApiClient::HTTP_GET, $this->_links->payments->href);
146
- $resourceCollection = new \Mollie\Api\Resources\PaymentCollection($this->client, $result->count, $result->_links);
 
 
147
  foreach ($result->_embedded->payments as $dataResult) {
148
- $resourceCollection[] = \Mollie\Api\Resources\ResourceFactory::createFromApiResult($dataResult, new \Mollie\Api\Resources\Payment($this->client));
149
  }
 
150
  return $resourceCollection;
151
  }
 
152
  /**
153
  * Retrieves all refunds associated with this profile
154
  *
@@ -158,13 +197,16 @@ class Profile extends \Mollie\Api\Resources\BaseResource
158
  public function refunds()
159
  {
160
  if (!isset($this->_links->refunds->href)) {
161
- return new \Mollie\Api\Resources\RefundCollection($this->client, 0, null);
162
  }
163
- $result = $this->client->performHttpCallToFullUrl(\Mollie\Api\MollieApiClient::HTTP_GET, $this->_links->refunds->href);
164
- $resourceCollection = new \Mollie\Api\Resources\RefundCollection($this->client, $result->count, $result->_links);
 
 
165
  foreach ($result->_embedded->refunds as $dataResult) {
166
- $resourceCollection[] = \Mollie\Api\Resources\ResourceFactory::createFromApiResult($dataResult, new \Mollie\Api\Resources\Refund($this->client));
167
  }
 
168
  return $resourceCollection;
169
  }
170
- }
5
  use Mollie\Api\Exceptions\ApiException;
6
  use Mollie\Api\MollieApiClient;
7
  use Mollie\Api\Types\ProfileStatus;
8
+
9
+ class Profile extends BaseResource
10
  {
11
  /**
12
  * @var string
13
  */
14
  public $resource;
15
+
16
  /**
17
  * @var string
18
  */
19
  public $id;
20
+
21
  /**
22
  * Test or live mode
23
  *
24
  * @var string
25
  */
26
  public $mode;
27
+
28
  /**
29
  * @var string
30
  */
31
  public $name;
32
+
33
  /**
34
  * @var string
35
  */
36
  public $website;
37
+
38
  /**
39
  * @var string
40
  */
41
  public $email;
42
+
43
  /**
44
  * @var string
45
  */
46
  public $phone;
47
+
48
  /**
49
  * See https://docs.mollie.com/reference/v2/profiles-api/get-profile
50
  *
51
  * @var int
52
  */
53
  public $categoryCode;
54
+
55
  /**
56
  * @var string
57
  */
58
  public $status;
59
+
60
  /**
61
  * @var object
62
  */
63
  public $review;
64
+
65
  /**
66
  * UTC datetime the profile was created in ISO-8601 format.
67
  *
69
  * @var string
70
  */
71
  public $createdAt;
72
+
73
  /**
74
  * @var object[]
75
  */
76
  public $_links;
77
+
78
  /**
79
  * @return bool
80
  */
81
  public function isUnverified()
82
  {
83
+ return $this->status == ProfileStatus::STATUS_UNVERIFIED;
84
  }
85
+
86
  /**
87
  * @return bool
88
  */
89
  public function isVerified()
90
  {
91
+ return $this->status == ProfileStatus::STATUS_VERIFIED;
92
  }
93
+
94
  /**
95
  * @return bool
96
  */
97
  public function isBlocked()
98
  {
99
+ return $this->status == ProfileStatus::STATUS_BLOCKED;
100
  }
101
+
102
  /**
103
  * @return Profile
104
  */
107
  if (!isset($this->_links->self->href)) {
108
  return $this;
109
  }
110
+
111
+ $body = json_encode(array(
112
+ "name" => $this->name,
113
+ "website" => $this->website,
114
+ "email" => $this->email,
115
+ "phone" => $this->phone,
116
+ "categoryCode" => $this->categoryCode,
117
+ "mode" => $this->mode,
118
+ ));
119
+
120
+ $result = $this->client->performHttpCallToFullUrl(MollieApiClient::HTTP_PATCH, $this->_links->self->href, $body);
121
+
122
+ return ResourceFactory::createFromApiResult($result, new Profile($this->client));
123
  }
124
+
125
  /**
126
  * Retrieves all chargebacks associated with this profile
127
  *
131
  public function chargebacks()
132
  {
133
  if (!isset($this->_links->chargebacks->href)) {
134
+ return new ChargebackCollection($this->client, 0, null);
135
  }
136
+
137
+ $result = $this->client->performHttpCallToFullUrl(MollieApiClient::HTTP_GET, $this->_links->chargebacks->href);
138
+
139
+ $resourceCollection = new ChargebackCollection($this->client, $result->count, $result->_links);
140
  foreach ($result->_embedded->chargebacks as $dataResult) {
141
+ $resourceCollection[] = ResourceFactory::createFromApiResult($dataResult, new Chargeback($this->client));
142
  }
143
+
144
  return $resourceCollection;
145
  }
146
+
147
  /**
148
  * Retrieves all methods activated on this profile
149
  *
153
  public function methods()
154
  {
155
  if (!isset($this->_links->methods->href)) {
156
+ return new MethodCollection(0, null);
157
  }
158
+
159
+ $result = $this->client->performHttpCallToFullUrl(MollieApiClient::HTTP_GET, $this->_links->methods->href);
160
+
161
+ $resourceCollection = new MethodCollection($result->count, $result->_links);
162
  foreach ($result->_embedded->methods as $dataResult) {
163
+ $resourceCollection[] = ResourceFactory::createFromApiResult($dataResult, new Method($this->client));
164
  }
165
+
166
  return $resourceCollection;
167
  }
168
+
169
  /**
170
  * Retrieves all payments associated with this profile
171
  *
175
  public function payments()
176
  {
177
  if (!isset($this->_links->payments->href)) {
178
+ return new PaymentCollection($this->client, 0, null);
179
  }
180
+
181
+ $result = $this->client->performHttpCallToFullUrl(MollieApiClient::HTTP_GET, $this->_links->payments->href);
182
+
183
+ $resourceCollection = new PaymentCollection($this->client, $result->count, $result->_links);
184
  foreach ($result->_embedded->payments as $dataResult) {
185
+ $resourceCollection[] = ResourceFactory::createFromApiResult($dataResult, new Payment($this->client));
186
  }
187
+
188
  return $resourceCollection;
189
  }
190
+
191
  /**
192
  * Retrieves all refunds associated with this profile
193
  *
197
  public function refunds()
198
  {
199
  if (!isset($this->_links->refunds->href)) {
200
+ return new RefundCollection($this->client, 0, null);
201
  }
202
+
203
+ $result = $this->client->performHttpCallToFullUrl(MollieApiClient::HTTP_GET, $this->_links->refunds->href);
204
+
205
+ $resourceCollection = new RefundCollection($this->client, $result->count, $result->_links);
206
  foreach ($result->_embedded->refunds as $dataResult) {
207
+ $resourceCollection[] = ResourceFactory::createFromApiResult($dataResult, new Refund($this->client));
208
  }
209
+
210
  return $resourceCollection;
211
  }
212
+ }
includes/mollie-api-php/src/Resources/ProfileCollection.php CHANGED
@@ -2,8 +2,9 @@
2
 
3
  namespace Mollie\Api\Resources;
4
 
5
- class ProfileCollection extends \Mollie\Api\Resources\CursorCollection
6
  {
 
7
  /**
8
  * @return string
9
  */
@@ -11,11 +12,12 @@ class ProfileCollection extends \Mollie\Api\Resources\CursorCollection
11
  {
12
  return "profiles";
13
  }
 
14
  /**
15
  * @return BaseResource
16
  */
17
  protected function createResourceObject()
18
  {
19
- return new \Mollie\Api\Resources\Profile($this->client);
20
  }
21
- }
2
 
3
  namespace Mollie\Api\Resources;
4
 
5
+ class ProfileCollection extends CursorCollection
6
  {
7
+
8
  /**
9
  * @return string
10
  */
12
  {
13
  return "profiles";
14
  }
15
+
16
  /**
17
  * @return BaseResource
18
  */
19
  protected function createResourceObject()
20
  {
21
+ return new Profile($this->client);
22
  }
23
+ }
includes/mollie-api-php/src/Resources/Refund.php CHANGED
@@ -4,24 +4,28 @@ namespace Mollie\Api\Resources;
4
 
5
  use Mollie\Api\MollieApiClient;
6
  use Mollie\Api\Types\RefundStatus;
7
- class Refund extends \Mollie\Api\Resources\BaseResource
 
8
  {
9
  /**
10
  * @var string
11
  */
12
  public $resource;
 
13
  /**
14
  * Id of the payment method.
15
  *
16
  * @var string
17
  */
18
  public $id;
 
19
  /**
20
  * The $amount that was refunded.
21
  *
22
  * @var object
23
  */
24
  public $amount;
 
25
  /**
26
  * UTC datetime the payment was created in ISO-8601 format.
27
  *
@@ -29,34 +33,40 @@ class Refund extends \Mollie\Api\Resources\BaseResource
29
  * @var string
30
  */
31
  public $createdAt;
 
32
  /**
33
  * The refund's description, if available.
34
  *
35
  * @var string|null
36
  */
37
  public $description;
 
38
  /**
39
  * The payment id that was refunded.
40
  *
41
  * @var string
42
  */
43
  public $paymentId;
 
44
  /**
45
  * The settlement amount
46
  *
47
  * @var object
48
  */
49
  public $settlementAmount;
 
50
  /**
51
  * The refund status
52
  *
53
  * @var string
54
  */
55
  public $status;
 
56
  /**
57
  * @var object[]
58
  */
59
  public $_links;
 
60
  /**
61
  * Is this refund queued?
62
  *
@@ -64,8 +74,9 @@ class Refund extends \Mollie\Api\Resources\BaseResource
64
  */
65
  public function isQueued()
66
  {
67
- return $this->status === \Mollie\Api\Types\RefundStatus::STATUS_QUEUED;
68
  }
 
69
  /**
70
  * Is this refund pending?
71
  *
@@ -73,8 +84,9 @@ class Refund extends \Mollie\Api\Resources\BaseResource
73
  */
74
  public function isPending()
75
  {
76
- return $this->status === \Mollie\Api\Types\RefundStatus::STATUS_PENDING;
77
  }
 
78
  /**
79
  * Is this refund processing?
80
  *
@@ -82,8 +94,9 @@ class Refund extends \Mollie\Api\Resources\BaseResource
82
  */
83
  public function isProcessing()
84
  {
85
- return $this->status === \Mollie\Api\Types\RefundStatus::STATUS_PROCESSING;
86
  }
 
87
  /**
88
  * Is this refund transferred to consumer?
89
  *
@@ -91,8 +104,9 @@ class Refund extends \Mollie\Api\Resources\BaseResource
91
  */
92
  public function isTransferred()
93
  {
94
- return $this->status === \Mollie\Api\Types\RefundStatus::STATUS_REFUNDED;
95
  }
 
96
  /**
97
  * Cancel the refund
98
  *
@@ -100,7 +114,11 @@ class Refund extends \Mollie\Api\Resources\BaseResource
100
  */
101
  public function cancel()
102
  {
103
- $dataResult = $this->client->performHttpCallToFullUrl(\Mollie\Api\MollieApiClient::HTTP_DELETE, $this->_links->self->href);
104
- return \Mollie\Api\Resources\ResourceFactory::createFromApiResult($dataResult, new self($this->client));
 
 
 
 
105
  }
106
  }
4
 
5
  use Mollie\Api\MollieApiClient;
6
  use Mollie\Api\Types\RefundStatus;
7
+
8
+ class Refund extends BaseResource
9
  {
10
  /**
11
  * @var string
12
  */
13
  public $resource;
14
+
15
  /**
16
  * Id of the payment method.
17
  *
18
  * @var string
19
  */
20
  public $id;
21
+
22
  /**
23
  * The $amount that was refunded.
24
  *
25
  * @var object
26
  */
27
  public $amount;
28
+
29
  /**
30
  * UTC datetime the payment was created in ISO-8601 format.
31
  *
33
  * @var string
34
  */
35
  public $createdAt;
36
+
37
  /**
38
  * The refund's description, if available.
39
  *
40
  * @var string|null
41
  */
42
  public $description;
43
+
44
  /**
45
  * The payment id that was refunded.
46
  *
47
  * @var string
48
  */
49
  public $paymentId;
50
+
51
  /**
52
  * The settlement amount
53
  *
54
  * @var object
55
  */
56
  public $settlementAmount;
57
+
58
  /**
59
  * The refund status
60
  *
61
  * @var string
62
  */
63
  public $status;
64
+
65
  /**
66
  * @var object[]
67
  */
68
  public $_links;
69
+
70
  /**
71
  * Is this refund queued?
72
  *
74
  */
75
  public function isQueued()
76
  {
77
+ return $this->status === RefundStatus::STATUS_QUEUED;
78
  }
79
+
80
  /**
81
  * Is this refund pending?
82
  *
84
  */
85
  public function isPending()
86
  {
87
+ return $this->status === RefundStatus::STATUS_PENDING;
88
  }
89
+
90
  /**
91
  * Is this refund processing?
92
  *
94
  */
95
  public function isProcessing()
96
  {
97
+ return $this->status === RefundStatus::STATUS_PROCESSING;
98
  }
99
+
100
  /**
101
  * Is this refund transferred to consumer?
102
  *
104
  */
105
  public function isTransferred()
106
  {
107
+ return $this->status === RefundStatus::STATUS_REFUNDED;
108
  }
109
+
110
  /**
111
  * Cancel the refund
112
  *
114
  */
115
  public function cancel()
116
  {
117
+ $dataResult = $this->client->performHttpCallToFullUrl(
118
+ MollieApiClient::HTTP_DELETE,
119
+ $this->_links->self->href
120
+ );
121
+
122
+ return ResourceFactory::createFromApiResult($dataResult, new self($this->client));
123
  }
124
  }
includes/mollie-api-php/src/Resources/RefundCollection.php CHANGED
@@ -2,7 +2,7 @@
2
 
3
  namespace Mollie\Api\Resources;
4
 
5
- class RefundCollection extends \Mollie\Api\Resources\CursorCollection
6
  {
7
  /**
8
  * @return string
@@ -11,11 +11,12 @@ class RefundCollection extends \Mollie\Api\Resources\CursorCollection
11
  {
12
  return "refunds";
13
  }
 
14
  /**
15
  * @return BaseResource
16
  */
17
  protected function createResourceObject()
18
  {
19
- return new \Mollie\Api\Resources\Refund($this->client);
20
  }
21
  }
2
 
3
  namespace Mollie\Api\Resources;
4
 
5
+ class RefundCollection extends CursorCollection
6
  {
7
  /**
8
  * @return string
11
  {
12
  return "refunds";
13
  }
14
+
15
  /**
16
  * @return BaseResource
17
  */
18
  protected function createResourceObject()
19
  {
20
+ return new Refund($this->client);
21
  }
22
  }
includes/mollie-api-php/src/Resources/ResourceFactory.php CHANGED
@@ -12,11 +12,13 @@ class ResourceFactory
12
  *
13
  * @return BaseResource
14
  */
15
- public static function createFromApiResult($apiResult, \Mollie\Api\Resources\BaseResource $resource)
16
  {
17
  foreach ($apiResult as $property => $value) {
18
  $resource->{$property} = $value;
19
  }
 
20
  return $resource;
21
  }
22
- }
 
12
  *
13
  * @return BaseResource
14
  */
15
+ public static function createFromApiResult($apiResult, BaseResource $resource)
16
  {
17
  foreach ($apiResult as $property => $value) {
18
  $resource->{$property} = $value;
19
  }
20
+
21
  return $resource;
22
  }
23
+
24
+ }
includes/mollie-api-php/src/Resources/Settlement.php CHANGED
@@ -5,24 +5,28 @@ namespace Mollie\Api\Resources;
5
  use Mollie\Api\Exceptions\ApiException;
6
  use Mollie\Api\MollieApiClient;
7
  use Mollie\Api\Types\SettlementStatus;
8
- class Settlement extends \Mollie\Api\Resources\BaseResource
 
9
  {
10
  /**
11
  * @var string
12
  */
13
  public $resource;
 
14
  /**
15
  * Id of the settlement.
16
  *
17
  * @var string
18
  */
19
  public $id;
 
20
  /**
21
  * The settlement reference. This corresponds to an invoice that's in your Dashboard.
22
  *
23
  * @var string
24
  */
25
  public $reference;
 
26
  /**
27
  * UTC datetime the payment was created in ISO-8601 format.
28
  *
@@ -30,28 +34,33 @@ class Settlement extends \Mollie\Api\Resources\BaseResource
30
  * @var string
31
  */
32
  public $createdAt;
 
33
  /**
34
  * Status of the settlement.
35
  *
36
  * @var string
37
  */
38
  public $status;
 
39
  /**
40
  * Total settlement amount in euros.
41
  *
42
  * @var object
43
  */
44
  public $amount;
 
45
  /**
46
  * Revenues and costs nested per year, per month, and per payment method.
47
  *
48
  * @var object
49
  */
50
  public $periods;
 
51
  /**
52
  * @var object[]
53
  */
54
  public $_links;
 
55
  /**
56
  * Is this settlement still open?
57
  *
@@ -59,8 +68,9 @@ class Settlement extends \Mollie\Api\Resources\BaseResource
59
  */
60
  public function isOpen()
61
  {
62
- return $this->status === \Mollie\Api\Types\SettlementStatus::STATUS_OPEN;
63
  }
 
64
  /**
65
  * Is this settlement pending?
66
  *
@@ -68,8 +78,9 @@ class Settlement extends \Mollie\Api\Resources\BaseResource
68
  */
69
  public function isPending()
70
  {
71
- return $this->status === \Mollie\Api\Types\SettlementStatus::STATUS_PENDING;
72
  }
 
73
  /**
74
  * Is this settlement paidout?
75
  *
@@ -77,8 +88,9 @@ class Settlement extends \Mollie\Api\Resources\BaseResource
77
  */
78
  public function isPaidout()
79
  {
80
- return $this->status === \Mollie\Api\Types\SettlementStatus::STATUS_PAIDOUT;
81
  }
 
82
  /**
83
  * Is this settlement failed?
84
  *
@@ -86,8 +98,9 @@ class Settlement extends \Mollie\Api\Resources\BaseResource
86
  */
87
  public function isFailed()
88
  {
89
- return $this->status === \Mollie\Api\Types\SettlementStatus::STATUS_FAILED;
90
  }
 
91
  /**
92
  * Retrieves all payments associated with this settlement
93
  *
@@ -97,15 +110,19 @@ class Settlement extends \Mollie\Api\Resources\BaseResource
97
  public function payments()
98
  {
99
  if (!isset($this->_links->payments->href)) {
100
- return new \Mollie\Api\Resources\PaymentCollection($this->client, 0, null);
101
  }
102
- $result = $this->client->performHttpCallToFullUrl(\Mollie\Api\MollieApiClient::HTTP_GET, $this->_links->payments->href);
103
- $resourceCollection = new \Mollie\Api\Resources\PaymentCollection($this->client, $result->count, $result->_links);
 
 
104
  foreach ($result->_embedded->payments as $dataResult) {
105
- $resourceCollection[] = \Mollie\Api\Resources\ResourceFactory::createFromApiResult($dataResult, new \Mollie\Api\Resources\Payment($this->client));
106
  }
 
107
  return $resourceCollection;
108
  }
 
109
  /**
110
  * Retrieves all refunds associated with this settlement
111
  *
@@ -115,15 +132,19 @@ class Settlement extends \Mollie\Api\Resources\BaseResource
115
  public function refunds()
116
  {
117
  if (!isset($this->_links->refunds->href)) {
118
- return new \Mollie\Api\Resources\RefundCollection($this->client, 0, null);
119
  }
120
- $result = $this->client->performHttpCallToFullUrl(\Mollie\Api\MollieApiClient::HTTP_GET, $this->_links->refunds->href);
121
- $resourceCollection = new \Mollie\Api\Resources\RefundCollection($this->client, $result->count, $result->_links);
 
 
122
  foreach ($result->_embedded->refunds as $dataResult) {
123
- $resourceCollection[] = \Mollie\Api\Resources\ResourceFactory::createFromApiResult($dataResult, new \Mollie\Api\Resources\Refund($this->client));
124
  }
 
125
  return $resourceCollection;
126
  }
 
127
  /**
128
  * Retrieves all chargebacks associated with this settlement
129
  *
@@ -133,13 +154,16 @@ class Settlement extends \Mollie\Api\Resources\BaseResource
133
  public function chargebacks()
134
  {
135
  if (!isset($this->_links->chargebacks->href)) {
136
- return new \Mollie\Api\Resources\ChargebackCollection($this->client, 0, null);
137
  }
138
- $result = $this->client->performHttpCallToFullUrl(\Mollie\Api\MollieApiClient::HTTP_GET, $this->_links->chargebacks->href);
139
- $resourceCollection = new \Mollie\Api\Resources\ChargebackCollection($this->client, $result->count, $result->_links);
 
 
140
  foreach ($result->_embedded->chargebacks as $dataResult) {
141
- $resourceCollection[] = \Mollie\Api\Resources\ResourceFactory::createFromApiResult($dataResult, new \Mollie\Api\Resources\Chargeback($this->client));
142
  }
 
143
  return $resourceCollection;
144
  }
145
- }
5
  use Mollie\Api\Exceptions\ApiException;
6
  use Mollie\Api\MollieApiClient;
7
  use Mollie\Api\Types\SettlementStatus;
8
+
9
+ class Settlement extends BaseResource
10
  {
11
  /**
12
  * @var string
13
  */
14
  public $resource;
15
+
16
  /**
17
  * Id of the settlement.
18
  *
19
  * @var string
20
  */
21
  public $id;
22
+
23
  /**
24
  * The settlement reference. This corresponds to an invoice that's in your Dashboard.
25
  *
26
  * @var string
27
  */
28
  public $reference;
29
+
30
  /**
31
  * UTC datetime the payment was created in ISO-8601 format.
32
  *
34
  * @var string
35
  */
36
  public $createdAt;
37
+
38
  /**
39
  * Status of the settlement.
40
  *
41
  * @var string
42
  */
43
  public $status;
44
+
45
  /**
46
  * Total settlement amount in euros.
47
  *
48
  * @var object
49
  */
50
  public $amount;
51
+
52
  /**
53
  * Revenues and costs nested per year, per month, and per payment method.
54
  *
55
  * @var object
56
  */
57
  public $periods;
58
+
59
  /**
60
  * @var object[]
61
  */
62
  public $_links;
63
+
64
  /**
65
  * Is this settlement still open?
66
  *
68
  */
69
  public function isOpen()
70
  {
71
+ return $this->status === SettlementStatus::STATUS_OPEN;
72
  }
73
+
74
  /**
75
  * Is this settlement pending?
76
  *
78
  */
79
  public function isPending()
80
  {
81
+ return $this->status === SettlementStatus::STATUS_PENDING;
82
  }
83
+
84
  /**
85
  * Is this settlement paidout?
86
  *
88
  */
89
  public function isPaidout()
90
  {
91
+ return $this->status === SettlementStatus::STATUS_PAIDOUT;
92
  }
93
+
94
  /**
95
  * Is this settlement failed?
96
  *
98
  */
99
  public function isFailed()
100
  {
101
+ return $this->status === SettlementStatus::STATUS_FAILED;
102
  }
103
+
104
  /**
105
  * Retrieves all payments associated with this settlement
106
  *
110
  public function payments()
111
  {
112
  if (!isset($this->_links->payments->href)) {
113
+ return new PaymentCollection($this->client, 0, null);
114
  }
115
+
116
+ $result = $this->client->performHttpCallToFullUrl(MollieApiClient::HTTP_GET, $this->_links->payments->href);
117
+
118
+ $resourceCollection = new PaymentCollection($this->client, $result->count, $result->_links);
119
  foreach ($result->_embedded->payments as $dataResult) {
120
+ $resourceCollection[] = ResourceFactory::createFromApiResult($dataResult, new Payment($this->client));
121
  }
122
+
123
  return $resourceCollection;
124
  }
125
+
126
  /**
127
  * Retrieves all refunds associated with this settlement
128
  *
132
  public function refunds()
133
  {
134
  if (!isset($this->_links->refunds->href)) {
135
+ return new RefundCollection($this->client, 0, null);
136
  }
137
+
138
+ $result = $this->client->performHttpCallToFullUrl(MollieApiClient::HTTP_GET, $this->_links->refunds->href);
139
+
140
+ $resourceCollection = new RefundCollection($this->client, $result->count, $result->_links);
141
  foreach ($result->_embedded->refunds as $dataResult) {
142
+ $resourceCollection[] = ResourceFactory::createFromApiResult($dataResult, new Refund($this->client));
143
  }
144
+
145
  return $resourceCollection;
146
  }
147
+
148
  /**
149
  * Retrieves all chargebacks associated with this settlement
150
  *
154
  public function chargebacks()
155
  {
156
  if (!isset($this->_links->chargebacks->href)) {
157
+ return new ChargebackCollection($this->client, 0, null);
158
  }
159
+
160
+ $result = $this->client->performHttpCallToFullUrl(MollieApiClient::HTTP_GET, $this->_links->chargebacks->href);
161
+
162
+ $resourceCollection = new ChargebackCollection($this->client, $result->count, $result->_links);
163
  foreach ($result->_embedded->chargebacks as $dataResult) {
164
+ $resourceCollection[] = ResourceFactory::createFromApiResult($dataResult, new Chargeback($this->client));
165
  }
166
+
167
  return $resourceCollection;
168
  }
169
+ }
includes/mollie-api-php/src/Resources/SettlementCollection.php CHANGED
@@ -2,7 +2,7 @@
2
 
3
  namespace Mollie\Api\Resources;
4
 
5
- class SettlementCollection extends \Mollie\Api\Resources\CursorCollection
6
  {
7
  /**
8
  * @return string
@@ -11,11 +11,12 @@ class SettlementCollection extends \Mollie\Api\Resources\CursorCollection
11
  {
12
  return "settlements";
13
  }
 
14
  /**
15
  * @return BaseResource
16
  */
17
  protected function createResourceObject()
18
  {
19
- return new \Mollie\Api\Resources\Settlement($this->client);
20
  }
21
- }
2
 
3
  namespace Mollie\Api\Resources;
4
 
5
+ class SettlementCollection extends CursorCollection
6
  {
7
  /**
8
  * @return string
11
  {
12
  return "settlements";
13
  }
14
+
15
  /**
16
  * @return BaseResource
17
  */
18
  protected function createResourceObject()
19
  {
20
+ return new Settlement($this->client);
21
  }
22
+ }
includes/mollie-api-php/src/Resources/Subscription.php CHANGED
@@ -4,78 +4,94 @@ namespace Mollie\Api\Resources;
4
 
5
  use Mollie\Api\MollieApiClient;
6
  use Mollie\Api\Types\SubscriptionStatus;
7
- class Subscription extends \Mollie\Api\Resources\BaseResource
 
8
  {
9
  /**
10
  * @var string
11
  */
12
  public $resource;
 
13
  /**
14
  * @var string
15
  */
16
  public $id;
 
17
  /**
18
  * @var string
19
  */
20
  public $customerId;
 
21
  /**
22
  * Either "live" or "test" depending on the customer's mode.
23
  *
24
  * @var string
25
  */
26
  public $mode;
 
27
  /**
28
  * UTC datetime the subscription created in ISO-8601 format.
29
  *
30
  * @var string
31
  */
32
  public $createdAt;
 
33
  /**
34
  * @var string
35
  */
36
  public $status;
 
37
  /**
38
  * @var object
39
  */
40
  public $amount;
 
41
  /**
42
  * @var int|null
43
  */
44
  public $times;
 
45
  /**
46
  * @var string
47
  */
48
  public $interval;
 
49
  /**
50
  * @var string
51
  */
52
  public $description;
 
53
  /**
54
  * @var string|null
55
  */
56
  public $method;
 
57
  /**
58
  * UTC datetime the subscription canceled in ISO-8601 format.
59
  *
60
  * @var string|null
61
  */
62
  public $canceledAt;
 
63
  /**
64
  * Date the subscription started. For example: 2018-04-24
65
  *
66
  * @var string|null
67
  */
68
  public $startDate;
 
69
  /**
70
  * Contains an optional 'webhookUrl'.
71
  *
72
  * @var object|null
73
  */
74
  public $webhookUrl;
 
75
  /**
76
  * @var object[]
77
  */
78
  public $_links;
 
79
  /**
80
  * @return BaseResource|Subscription
81
  * @throws \Mollie\Api\Exceptions\ApiException
@@ -85,53 +101,72 @@ class Subscription extends \Mollie\Api\Resources\BaseResource
85
  if (!isset($this->_links->self->href)) {
86
  return $this;
87
  }
88
- $body = \json_encode(array("amount" => $this->amount, "times" => $this->times, "startDate" => $this->startDate, "webhookUrl" => $this->webhookUrl, "description" => $this->description));
89
- $result = $this->client->performHttpCallToFullUrl(\Mollie\Api\MollieApiClient::HTTP_PATCH, $this->_links->self->href, $body);
90
- return \Mollie\Api\Resources\ResourceFactory::createFromApiResult($result, new \Mollie\Api\Resources\Subscription($this->client));
 
 
 
 
 
 
 
 
 
 
 
 
 
91
  }
 
 
92
  /**
93
  * Returns whether the Subscription is active or not.
94
  *
95
  * @return bool
96
  */
97
- public function isActive()
98
  {
99
- return $this->status === \Mollie\Api\Types\SubscriptionStatus::STATUS_ACTIVE;
100
  }
 
101
  /**
102
  * Returns whether the Subscription is pending or not.
103
  *
104
  * @return bool
105
  */
106
- public function isPending()
107
  {
108
- return $this->status === \Mollie\Api\Types\SubscriptionStatus::STATUS_PENDING;
109
  }
 
110
  /**
111
  * Returns whether the Subscription is canceled or not.
112
  *
113
  * @return bool
114
  */
115
- public function isCanceled()
116
  {
117
- return $this->status === \Mollie\Api\Types\SubscriptionStatus::STATUS_CANCELED;
118
  }
 
119
  /**
120
  * Returns whether the Subscription is suspended or not.
121
  *
122
  * @return bool
123
  */
124
- public function isSuspended()
125
  {
126
- return $this->status === \Mollie\Api\Types\SubscriptionStatus::STATUS_SUSPENDED;
127
  }
 
128
  /**
129
  * Returns whether the Subscription is completed or not.
130
  *
131
  * @return bool
132
  */
133
- public function isCompleted()
134
  {
135
- return $this->status === \Mollie\Api\Types\SubscriptionStatus::STATUS_COMPLETED;
136
  }
137
- }
4
 
5
  use Mollie\Api\MollieApiClient;
6
  use Mollie\Api\Types\SubscriptionStatus;
7
+
8
+ class Subscription extends BaseResource
9
  {
10
  /**
11
  * @var string
12
  */
13
  public $resource;
14
+
15
  /**
16
  * @var string
17
  */
18
  public $id;
19
+
20
  /**
21
  * @var string
22
  */
23
  public $customerId;
24
+
25
  /**
26
  * Either "live" or "test" depending on the customer's mode.
27
  *
28
  * @var string
29
  */
30
  public $mode;
31
+
32
  /**
33
  * UTC datetime the subscription created in ISO-8601 format.
34
  *
35
  * @var string
36
  */
37
  public $createdAt;
38
+
39
  /**
40
  * @var string
41
  */
42
  public $status;
43
+
44
  /**
45
  * @var object
46
  */
47
  public $amount;
48
+
49
  /**
50
  * @var int|null
51
  */
52
  public $times;
53
+
54
  /**
55
  * @var string
56
  */
57
  public $interval;
58
+
59
  /**
60
  * @var string
61
  */
62
  public $description;
63
+
64
  /**
65
  * @var string|null
66
  */
67
  public $method;
68
+
69
  /**
70
  * UTC datetime the subscription canceled in ISO-8601 format.
71
  *
72
  * @var string|null
73
  */
74
  public $canceledAt;
75
+
76
  /**
77
  * Date the subscription started. For example: 2018-04-24
78
  *
79
  * @var string|null
80
  */
81
  public $startDate;
82
+
83
  /**
84
  * Contains an optional 'webhookUrl'.
85
  *
86
  * @var object|null
87
  */
88
  public $webhookUrl;
89
+
90
  /**
91
  * @var object[]
92
  */
93
  public $_links;
94
+
95
  /**
96
  * @return BaseResource|Subscription
97
  * @throws \Mollie\Api\Exceptions\ApiException
101
  if (!isset($this->_links->self->href)) {
102
  return $this;
103
  }
104
+
105
+ $body = json_encode(array(
106
+ "amount" => $this->amount,
107
+ "times" => $this->times,
108
+ "startDate" => $this->startDate,
109
+ "webhookUrl" => $this->webhookUrl,
110
+ "description" => $this->description,
111
+ ));
112
+
113
+ $result = $this->client->performHttpCallToFullUrl(
114
+ MollieApiClient::HTTP_PATCH,
115
+ $this->_links->self->href,
116
+ $body
117
+ );
118
+
119
+ return ResourceFactory::createFromApiResult($result, new Subscription($this->client));
120
  }
121
+
122
+
123
  /**
124
  * Returns whether the Subscription is active or not.
125
  *
126
  * @return bool
127
  */
128
+ public function isActive ()
129
  {
130
+ return $this->status === SubscriptionStatus::STATUS_ACTIVE;
131
  }
132
+
133
  /**
134
  * Returns whether the Subscription is pending or not.
135
  *
136
  * @return bool
137
  */
138
+ public function isPending ()
139
  {
140
+ return $this->status === SubscriptionStatus::STATUS_PENDING;
141
  }
142
+
143
  /**
144
  * Returns whether the Subscription is canceled or not.
145
  *
146
  * @return bool
147
  */
148
+ public function isCanceled ()
149
  {
150
+ return $this->status === SubscriptionStatus::STATUS_CANCELED;
151
  }
152
+
153
  /**
154
  * Returns whether the Subscription is suspended or not.
155
  *
156
  * @return bool
157
  */
158
+ public function isSuspended ()
159
  {
160
+ return $this->status === SubscriptionStatus::STATUS_SUSPENDED;
161
  }
162
+
163
  /**
164
  * Returns whether the Subscription is completed or not.
165
  *
166
  * @return bool
167
  */
168
+ public function isCompleted ()
169
  {
170
+ return $this->status === SubscriptionStatus::STATUS_COMPLETED;
171
  }
172
+ }
includes/mollie-api-php/src/Resources/SubscriptionCollection.php CHANGED
@@ -2,8 +2,9 @@
2
 
3
  namespace Mollie\Api\Resources;
4
 
5
- class SubscriptionCollection extends \Mollie\Api\Resources\CursorCollection
6
  {
 
7
  /**
8
  * @return string
9
  */
@@ -11,11 +12,12 @@ class SubscriptionCollection extends \Mollie\Api\Resources\CursorCollection
11
  {
12
  return "subscriptions";
13
  }
 
14
  /**
15
  * @return BaseResource
16
  */
17
  protected function createResourceObject()
18
  {
19
- return new \Mollie\Api\Resources\Subscription($this->client);
20
  }
21
- }
2
 
3
  namespace Mollie\Api\Resources;
4
 
5
+ class SubscriptionCollection extends CursorCollection
6
  {
7
+
8
  /**
9
  * @return string
10
  */
12
  {
13
  return "subscriptions";
14
  }
15
+
16
  /**
17
  * @return BaseResource
18
  */
19
  protected function createResourceObject()
20
  {
21
+ return new Subscription($this->client);
22
  }
23
+ }
includes/mollie-api-php/src/Types/InvoiceStatus.php CHANGED
@@ -8,12 +8,14 @@ class InvoiceStatus
8
  * The invoice is not paid yet.
9
  */
10
  const STATUS_OPEN = "open";
 
11
  /**
12
  * The invoice is paid.
13
  */
14
  const STATUS_PAID = "paid";
 
15
  /**
16
  * Payment of the invoice is overdue.
17
  */
18
  const STATUS_OVERDUE = "overdue";
19
- }
8
  * The invoice is not paid yet.
9
  */
10
  const STATUS_OPEN = "open";
11
+
12
  /**
13
  * The invoice is paid.
14
  */
15
  const STATUS_PAID = "paid";
16
+
17
  /**
18
  * Payment of the invoice is overdue.
19
  */
20
  const STATUS_OVERDUE = "overdue";
21
+ }
includes/mollie-api-php/src/Types/MandateMethod.php CHANGED
@@ -5,4 +5,4 @@ namespace Mollie\Api\Types;
5
  class MandateMethod
6
  {
7
  const DIRECTDEBIT = "directdebit";
8
- }
5
  class MandateMethod
6
  {
7
  const DIRECTDEBIT = "directdebit";
8
+ }
includes/mollie-api-php/src/Types/MandateStatus.php CHANGED
@@ -5,6 +5,6 @@ namespace Mollie\Api\Types;
5
  class MandateStatus
6
  {
7
  const STATUS_PENDING = "pending";
8
- const STATUS_VALID = "valid";
9
  const STATUS_INVALID = "invalid";
10
- }
5
  class MandateStatus
6
  {
7
  const STATUS_PENDING = "pending";
8
+ const STATUS_VALID = "valid";
9
  const STATUS_INVALID = "invalid";
10
+ }
includes/mollie-api-php/src/Types/PaymentMethod.php CHANGED
@@ -8,63 +8,78 @@ class PaymentMethod
8
  * @link https://www.mollie.com/en/payments/bancontact
9
  */
10
  const BANCONTACT = "bancontact";
 
11
  /**
12
  * @link https://www.mollie.com/en/payments/bank-transfer
13
  */
14
  const BANKTRANSFER = "banktransfer";
 
15
  /**
16
  * @link https://www.mollie.com/en/payments/belfius
17
  */
18
  const BELFIUS = "belfius";
 
19
  /**
20
  * @link https://www.mollie.com/en/payments/bitcoin
21
  */
22
  const BITCOIN = "bitcoin";
 
23
  /**
24
  * @link https://www.mollie.com/en/payments/credit-card
25
  */
26
  const CREDITCARD = "creditcard";
 
27
  /**
28
  * @link https://www.mollie.com/en/payments/direct-debit
29
  */
30
  const DIRECTDEBIT = "directdebit";
 
31
  /**
32
  * @link https://www.mollie.com/en/payments/eps
33
  */
34
  const EPS = "eps";
 
35
  /**
36
  * @link https://www.mollie.com/en/payments/gift-cards
37
  */
38
  const GIFTCARD = "giftcard";
 
39
  /**
40
  * @link https://www.mollie.com/en/payments/giropay
41
  */
42
  const GIROPAY = "giropay";
 
43
  /**
44
  * @link https://www.mollie.com/en/payments/ideal
45
  */
46
  const IDEAL = "ideal";
 
47
  /**
48
  * @link https://www.mollie.com/en/payments/ing-homepay
49
  */
50
  const INGHOMEPAY = "inghomepay";
 
51
  /**
52
  * @link https://www.mollie.com/en/payments/kbc-cbc
53
  */
54
  const KBC = "kbc";
 
55
  /**
56
  * @link https://www.mollie.com/en/payments/paypal
57
  */
58
  const PAYPAL = "paypal";
 
59
  /**
60
  * @link https://www.mollie.com/en/payments/paysafecard
61
  */
62
  const PAYSAFECARD = "paysafecard";
 
63
  /**
64
  * @deprecated
65
  * @link https://www.mollie.com/en/payments/gift-cards
66
  */
67
  const PODIUMCADEAUKAART = "podiumcadeaukaart";
 
68
  /**
69
  * @link https://www.mollie.com/en/payments/sofort
70
  */
8
  * @link https://www.mollie.com/en/payments/bancontact
9
  */
10
  const BANCONTACT = "bancontact";
11
+
12
  /**
13
  * @link https://www.mollie.com/en/payments/bank-transfer
14
  */
15
  const BANKTRANSFER = "banktransfer";
16
+
17
  /**
18
  * @link https://www.mollie.com/en/payments/belfius
19
  */
20
  const BELFIUS = "belfius";
21
+
22
  /**
23
  * @link https://www.mollie.com/en/payments/bitcoin
24
  */
25
  const BITCOIN = "bitcoin";
26
+
27
  /**
28
  * @link https://www.mollie.com/en/payments/credit-card
29
  */
30
  const CREDITCARD = "creditcard";
31
+
32
  /**
33
  * @link https://www.mollie.com/en/payments/direct-debit
34
  */
35
  const DIRECTDEBIT = "directdebit";
36
+
37
  /**
38
  * @link https://www.mollie.com/en/payments/eps
39
  */
40
  const EPS = "eps";
41
+
42
  /**
43
  * @link https://www.mollie.com/en/payments/gift-cards
44
  */
45
  const GIFTCARD = "giftcard";
46
+
47
  /**
48
  * @link https://www.mollie.com/en/payments/giropay
49
  */
50
  const GIROPAY = "giropay";
51
+
52
  /**
53
  * @link https://www.mollie.com/en/payments/ideal
54
  */
55
  const IDEAL = "ideal";
56
+
57
  /**
58
  * @link https://www.mollie.com/en/payments/ing-homepay
59
  */
60
  const INGHOMEPAY = "inghomepay";
61
+
62
  /**
63
  * @link https://www.mollie.com/en/payments/kbc-cbc
64
  */
65
  const KBC = "kbc";
66
+
67
  /**
68
  * @link https://www.mollie.com/en/payments/paypal
69
  */
70
  const PAYPAL = "paypal";
71
+
72
  /**
73
  * @link https://www.mollie.com/en/payments/paysafecard
74
  */
75
  const PAYSAFECARD = "paysafecard";
76
+
77
  /**
78
  * @deprecated
79
  * @link https://www.mollie.com/en/payments/gift-cards
80
  */
81
  const PODIUMCADEAUKAART = "podiumcadeaukaart";
82
+
83
  /**
84
  * @link https://www.mollie.com/en/payments/sofort
85
  */
includes/mollie-api-php/src/Types/PaymentStatus.php CHANGED
@@ -8,22 +8,27 @@ class PaymentStatus
8
  * The payment has just been created, no action has happened on it yet.
9
  */
10
  const STATUS_OPEN = "open";
 
11
  /**
12
  * The payment has just been started, no final confirmation yet.
13
  */
14
  const STATUS_PENDING = "pending";
 
15
  /**
16
  * The customer has canceled the payment.
17
  */
18
  const STATUS_CANCELED = "canceled";
 
19
  /**
20
  * The payment has expired due to inaction of the customer.
21
  */
22
  const STATUS_EXPIRED = "expired";
 
23
  /**
24
  * The payment has been paid.
25
  */
26
  const STATUS_PAID = "paid";
 
27
  /**
28
  * The payment has failed.
29
  */
8
  * The payment has just been created, no action has happened on it yet.
9
  */
10
  const STATUS_OPEN = "open";
11
+
12
  /**
13
  * The payment has just been started, no final confirmation yet.
14
  */
15
  const STATUS_PENDING = "pending";
16
+
17
  /**
18
  * The customer has canceled the payment.
19
  */
20
  const STATUS_CANCELED = "canceled";
21
+
22
  /**
23
  * The payment has expired due to inaction of the customer.
24
  */
25
  const STATUS_EXPIRED = "expired";
26
+
27
  /**
28
  * The payment has been paid.
29
  */
30
  const STATUS_PAID = "paid";
31
+
32
  /**
33
  * The payment has failed.
34
  */
includes/mollie-api-php/src/Types/ProfileStatus.php CHANGED
@@ -8,12 +8,14 @@ class ProfileStatus
8
  * The profile has not been verified yet and can only be used to create test payments.
9
  */
10
  const STATUS_UNVERIFIED = 'unverified';
 
11
  /**
12
  * The profile has been verified and can be used to create live payments and test payments.
13
  */
14
  const STATUS_VERIFIED = 'verified';
 
15
  /**
16
  * The profile is blocked and can thus no longer be used or changed.
17
  */
18
  const STATUS_BLOCKED = 'blocked';
19
- }
8
  * The profile has not been verified yet and can only be used to create test payments.
9
  */
10
  const STATUS_UNVERIFIED = 'unverified';
11
+
12
  /**
13
  * The profile has been verified and can be used to create live payments and test payments.
14
  */
15
  const STATUS_VERIFIED = 'verified';
16
+
17
  /**
18
  * The profile is blocked and can thus no longer be used or changed.
19
  */
20
  const STATUS_BLOCKED = 'blocked';
21
+ }
includes/mollie-api-php/src/Types/RefundStatus.php CHANGED
@@ -8,14 +8,17 @@ class RefundStatus
8
  * The refund is queued until there is enough balance to process te refund. You can still cancel the refund.
9
  */
10
  const STATUS_QUEUED = 'queued';
 
11
  /**
12
  * The refund will be sent to the bank on the next business day. You can still cancel the refund.
13
  */
14
  const STATUS_PENDING = 'pending';
 
15
  /**
16
  * The refund has been sent to the bank. The refund amount will be transferred to the consumer account as soon as possible.
17
  */
18
  const STATUS_PROCESSING = 'processing';
 
19
  /**
20
  * The refund amount has been transferred to the consumer.
21
  */
8
  * The refund is queued until there is enough balance to process te refund. You can still cancel the refund.
9
  */
10
  const STATUS_QUEUED = 'queued';
11
+
12
  /**
13
  * The refund will be sent to the bank on the next business day. You can still cancel the refund.
14
  */
15
  const STATUS_PENDING = 'pending';
16
+
17
  /**
18
  * The refund has been sent to the bank. The refund amount will be transferred to the consumer account as soon as possible.
19
  */
20
  const STATUS_PROCESSING = 'processing';
21
+
22
  /**
23
  * The refund amount has been transferred to the consumer.
24
  */
includes/mollie-api-php/src/Types/SettlementStatus.php CHANGED
@@ -8,14 +8,17 @@ class SettlementStatus
8
  * The settlement has not been closed yet.
9
  */
10
  const STATUS_OPEN = 'open';
 
11
  /**
12
  * The settlement has been closed and is being processed.
13
  */
14
  const STATUS_PENDING = 'pending';
 
15
  /**
16
  * The settlement has been paid out.
17
  */
18
  const STATUS_PAIDOUT = 'paidout';
 
19
  /**
20
  * The settlement could not be paid out.
21
  */
8
  * The settlement has not been closed yet.
9
  */
10
  const STATUS_OPEN = 'open';
11
+
12
  /**
13
  * The settlement has been closed and is being processed.
14
  */
15
  const STATUS_PENDING = 'pending';
16
+
17
  /**
18
  * The settlement has been paid out.
19
  */
20
  const STATUS_PAIDOUT = 'paidout';
21
+
22
  /**
23
  * The settlement could not be paid out.
24
  */
includes/mollie-api-php/src/Types/SubscriptionStatus.php CHANGED
@@ -4,11 +4,9 @@ namespace Mollie\Api\Types;
4
 
5
  class SubscriptionStatus
6
  {
7
- const STATUS_ACTIVE = "active";
8
- const STATUS_PENDING = "pending";
9
- // Waiting for a valid mandate.
10
- const STATUS_CANCELED = "canceled";
11
- const STATUS_SUSPENDED = "suspended";
12
- // Active, but mandate became invalid.
13
  const STATUS_COMPLETED = "completed";
14
- }
4
 
5
  class SubscriptionStatus
6
  {
7
+ const STATUS_ACTIVE = "active";
8
+ const STATUS_PENDING = "pending"; // Waiting for a valid mandate.
9
+ const STATUS_CANCELED = "canceled";
10
+ const STATUS_SUSPENDED = "suspended"; // Active, but mandate became invalid.
 
 
11
  const STATUS_COMPLETED = "completed";
12
+ }
includes/mollie-api-php/vendor/autoload.php CHANGED
@@ -1,29 +1,7 @@
1
  <?php
2
 
3
- // scoper-composer-autoload.php @generated by PhpScoper
4
 
5
- $loader = require_once __DIR__.'/composer-autoload.php';
6
 
7
- // Aliases for the whitelisted classes. For more information see:
8
- // https://github.com/humbug/php-scoper/blob/master/README.md#class-whitelisting
9
- class_exists('_PhpScoper5b6804f9734c8\GuzzleHttp\ClientInterface');
10
-
11
- // Functions whitelisting. For more information see:
12
- // https://github.com/humbug/php-scoper/blob/master/README.md#functions-whitelisting
13
- if (!function_exists('database_write')) {
14
- function database_write() {
15
- return \_PhpScoper5b6804f9734c8\database_write(...func_get_args());
16
- }
17
- }
18
- if (!function_exists('database_read')) {
19
- function database_read() {
20
- return \_PhpScoper5b6804f9734c8\database_read(...func_get_args());
21
- }
22
- }
23
- if (!function_exists('composerRequire4062f91c07f6f2ba911ecd0f0813a468')) {
24
- function composerRequire4062f91c07f6f2ba911ecd0f0813a468() {
25
- return \_PhpScoper5b6804f9734c8\composerRequire4062f91c07f6f2ba911ecd0f0813a468(...func_get_args());
26
- }
27
- }
28
-
29
- return $loader;
1
  <?php
2
 
3
+ // autoload.php @generated by Composer
4
 
5
+ require_once __DIR__ . '/composer/autoload_real.php';
6
 
7
+ return ComposerAutoloaderInitf1d08e70f69871d38ce5b109d41f0cad::getLoader();
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
includes/mollie-api-php/vendor/composer-autoload.php DELETED
@@ -1,7 +0,0 @@
1
- <?php
2
-
3
- // autoload.php @generated by Composer
4
-
5
- require_once __DIR__ . '/composer/autoload_real.php';
6
-
7
- return ComposerAutoloaderInit4062f91c07f6f2ba911ecd0f0813a468::getLoader();
 
 
 
 
 
 
 
includes/mollie-api-php/vendor/composer/autoload_classmap.php CHANGED
@@ -6,154 +6,4 @@ $vendorDir = dirname(dirname(__FILE__));
6
  $baseDir = dirname($vendorDir);
7
 
8
  return array(
9
- 'Mollie\\Api\\CompatibilityChecker' => $baseDir . '/src/CompatibilityChecker.php',
10
- 'Mollie\\Api\\Endpoints\\CustomerEndpoint' => $baseDir . '/src/Endpoints/CustomerEndpoint.php',
11
- 'Mollie\\Api\\Endpoints\\CustomerPaymentsEndpoint' => $baseDir . '/src/Endpoints/CustomerPaymentsEndpoint.php',
12
- 'Mollie\\Api\\Endpoints\\EndpointAbstract' => $baseDir . '/src/Endpoints/EndpointAbstract.php',
13
- 'Mollie\\Api\\Endpoints\\InvoiceEndpoint' => $baseDir . '/src/Endpoints/InvoiceEndpoint.php',
14
- 'Mollie\\Api\\Endpoints\\MandateEndpoint' => $baseDir . '/src/Endpoints/MandateEndpoint.php',
15
- 'Mollie\\Api\\Endpoints\\MethodEndpoint' => $baseDir . '/src/Endpoints/MethodEndpoint.php',
16
- 'Mollie\\Api\\Endpoints\\PaymentEndpoint' => $baseDir . '/src/Endpoints/PaymentEndpoint.php',
17
- 'Mollie\\Api\\Endpoints\\PaymentRefundEndpoint' => $baseDir . '/src/Endpoints/PaymentRefundEndpoint.php',
18
- 'Mollie\\Api\\Endpoints\\ProfileEndpoint' => $baseDir . '/src/Endpoints/ProfileEndpoint.php',
19
- 'Mollie\\Api\\Endpoints\\RefundEndpoint' => $baseDir . '/src/Endpoints/RefundEndpoint.php',
20
- 'Mollie\\Api\\Endpoints\\SettlementsEndpoint' => $baseDir . '/src/Endpoints/SettlementsEndpoint.php',
21
- 'Mollie\\Api\\Endpoints\\SubscriptionEndpoint' => $baseDir . '/src/Endpoints/SubscriptionEndpoint.php',
22
- 'Mollie\\Api\\Exceptions\\ApiException' => $baseDir . '/src/Exceptions/ApiException.php',
23
- 'Mollie\\Api\\Exceptions\\IncompatiblePlatform' => $baseDir . '/src/Exceptions/IncompatiblePlatform.php',
24
- 'Mollie\\Api\\MollieApiClient' => $baseDir . '/src/MollieApiClient.php',
25
- 'Mollie\\Api\\Resources\\BaseCollection' => $baseDir . '/src/Resources/BaseCollection.php',
26
- 'Mollie\\Api\\Resources\\BaseResource' => $baseDir . '/src/Resources/BaseResource.php',
27
- 'Mollie\\Api\\Resources\\Chargeback' => $baseDir . '/src/Resources/Chargeback.php',
28
- 'Mollie\\Api\\Resources\\ChargebackCollection' => $baseDir . '/src/Resources/ChargebackCollection.php',
29
- 'Mollie\\Api\\Resources\\CursorCollection' => $baseDir . '/src/Resources/CursorCollection.php',
30
- 'Mollie\\Api\\Resources\\Customer' => $baseDir . '/src/Resources/Customer.php',
31
- 'Mollie\\Api\\Resources\\CustomerCollection' => $baseDir . '/src/Resources/CustomerCollection.php',
32
- 'Mollie\\Api\\Resources\\Invoice' => $baseDir . '/src/Resources/Invoice.php',
33
- 'Mollie\\Api\\Resources\\InvoiceCollection' => $baseDir . '/src/Resources/InvoiceCollection.php',
34
- 'Mollie\\Api\\Resources\\Issuer' => $baseDir . '/src/Resources/Issuer.php',
35
- 'Mollie\\Api\\Resources\\IssuerCollection' => $baseDir . '/src/Resources/IssuerCollection.php',
36
- 'Mollie\\Api\\Resources\\Mandate' => $baseDir . '/src/Resources/Mandate.php',
37
- 'Mollie\\Api\\Resources\\MandateCollection' => $baseDir . '/src/Resources/MandateCollection.php',
38
- 'Mollie\\Api\\Resources\\Method' => $baseDir . '/src/Resources/Method.php',
39
- 'Mollie\\Api\\Resources\\MethodCollection' => $baseDir . '/src/Resources/MethodCollection.php',
40
- 'Mollie\\Api\\Resources\\Payment' => $baseDir . '/src/Resources/Payment.php',
41
- 'Mollie\\Api\\Resources\\PaymentCollection' => $baseDir . '/src/Resources/PaymentCollection.php',
42
- 'Mollie\\Api\\Resources\\Profile' => $baseDir . '/src/Resources/Profile.php',
43
- 'Mollie\\Api\\Resources\\ProfileCollection' => $baseDir . '/src/Resources/ProfileCollection.php',
44
- 'Mollie\\Api\\Resources\\Refund' => $baseDir . '/src/Resources/Refund.php',
45
- 'Mollie\\Api\\Resources\\RefundCollection' => $baseDir . '/src/Resources/RefundCollection.php',
46
- 'Mollie\\Api\\Resources\\ResourceFactory' => $baseDir . '/src/Resources/ResourceFactory.php',
47
- 'Mollie\\Api\\Resources\\Settlement' => $baseDir . '/src/Resources/Settlement.php',
48
- 'Mollie\\Api\\Resources\\SettlementCollection' => $baseDir . '/src/Resources/SettlementCollection.php',
49
- 'Mollie\\Api\\Resources\\Subscription' => $baseDir . '/src/Resources/Subscription.php',
50
- 'Mollie\\Api\\Resources\\SubscriptionCollection' => $baseDir . '/src/Resources/SubscriptionCollection.php',
51
- 'Mollie\\Api\\Types\\InvoiceStatus' => $baseDir . '/src/Types/InvoiceStatus.php',
52
- 'Mollie\\Api\\Types\\MandateMethod' => $baseDir . '/src/Types/MandateMethod.php',
53
- 'Mollie\\Api\\Types\\MandateStatus' => $baseDir . '/src/Types/MandateStatus.php',
54
- 'Mollie\\Api\\Types\\PaymentMethod' => $baseDir . '/src/Types/PaymentMethod.php',
55
- 'Mollie\\Api\\Types\\PaymentStatus' => $baseDir . '/src/Types/PaymentStatus.php',
56
- 'Mollie\\Api\\Types\\ProfileStatus' => $baseDir . '/src/Types/ProfileStatus.php',
57
- 'Mollie\\Api\\Types\\RefundStatus' => $baseDir . '/src/Types/RefundStatus.php',
58
- 'Mollie\\Api\\Types\\SequenceType' => $baseDir . '/src/Types/SequenceType.php',
59
- 'Mollie\\Api\\Types\\SettlementStatus' => $baseDir . '/src/Types/SettlementStatus.php',
60
- 'Mollie\\Api\\Types\\SubscriptionStatus' => $baseDir . '/src/Types/SubscriptionStatus.php',
61
- '_PhpScoper5b6804f9734c8\\Composer\\CaBundle\\CaBundle' => $vendorDir . '/composer/ca-bundle/src/CaBundle.php',
62
- '_PhpScoper5b6804f9734c8\\GuzzleHttp\\Client' => $vendorDir . '/guzzlehttp/guzzle/src/Client.php',
63
- '_PhpScoper5b6804f9734c8\\GuzzleHttp\\ClientInterface' => $vendorDir . '/guzzlehttp/guzzle/src/ClientInterface.php',
64
- '_PhpScoper5b6804f9734c8\\GuzzleHttp\\Cookie\\CookieJar' => $vendorDir . '/guzzlehttp/guzzle/src/Cookie/CookieJar.php',
65
- '_PhpScoper5b6804f9734c8\\GuzzleHttp\\Cookie\\CookieJarInterface' => $vendorDir . '/guzzlehttp/guzzle/src/Cookie/CookieJarInterface.php',
66
- '_PhpScoper5b6804f9734c8\\GuzzleHttp\\Cookie\\FileCookieJar' => $vendorDir . '/guzzlehttp/guzzle/src/Cookie/FileCookieJar.php',
67
- '_PhpScoper5b6804f9734c8\\GuzzleHttp\\Cookie\\SessionCookieJar' => $vendorDir . '/guzzlehttp/guzzle/src/Cookie/SessionCookieJar.php',
68
- '_PhpScoper5b6804f9734c8\\GuzzleHttp\\Cookie\\SetCookie' => $vendorDir . '/guzzlehttp/guzzle/src/Cookie/SetCookie.php',
69
- '_PhpScoper5b6804f9734c8\\GuzzleHttp\\Exception\\BadResponseException' => $vendorDir . '/guzzlehttp/guzzle/src/Exception/BadResponseException.php',
70
- '_PhpScoper5b6804f9734c8\\GuzzleHttp\\Exception\\ClientException' => $vendorDir . '/guzzlehttp/guzzle/src/Exception/ClientException.php',
71
- '_PhpScoper5b6804f9734c8\\GuzzleHttp\\Exception\\ConnectException' => $vendorDir . '/guzzlehttp/guzzle/src/Exception/ConnectException.php',
72
- '_PhpScoper5b6804f9734c8\\GuzzleHttp\\Exception\\GuzzleException' => $vendorDir . '/guzzlehttp/guzzle/src/Exception/GuzzleException.php',
73
- '_PhpScoper5b6804f9734c8\\GuzzleHttp\\Exception\\RequestException' => $vendorDir . '/guzzlehttp/guzzle/src/Exception/RequestException.php',
74
- '_PhpScoper5b6804f9734c8\\GuzzleHttp\\Exception\\SeekException' => $vendorDir . '/guzzlehttp/guzzle/src/Exception/SeekException.php',
75
- '_PhpScoper5b6804f9734c8\\GuzzleHttp\\Exception\\ServerException' => $vendorDir . '/guzzlehttp/guzzle/src/Exception/ServerException.php',
76
- '_PhpScoper5b6804f9734c8\\GuzzleHttp\\Exception\\TooManyRedirectsException' => $vendorDir . '/guzzlehttp/guzzle/src/Exception/TooManyRedirectsException.php',
77
- '_PhpScoper5b6804f9734c8\\GuzzleHttp\\Exception\\TransferException' => $vendorDir . '/guzzlehttp/guzzle/src/Exception/TransferException.php',
78
- '_PhpScoper5b6804f9734c8\\GuzzleHttp\\HandlerStack' => $vendorDir . '/guzzlehttp/guzzle/src/HandlerStack.php',
79
- '_PhpScoper5b6804f9734c8\\GuzzleHttp\\Handler\\CurlFactory' => $vendorDir . '/guzzlehttp/guzzle/src/Handler/CurlFactory.php',
80
- '_PhpScoper5b6804f9734c8\\GuzzleHttp\\Handler\\CurlFactoryInterface' => $vendorDir . '/guzzlehttp/guzzle/src/Handler/CurlFactoryInterface.php',
81
- '_PhpScoper5b6804f9734c8\\GuzzleHttp\\Handler\\CurlHandler' => $vendorDir . '/guzzlehttp/guzzle/src/Handler/CurlHandler.php',
82
- '_PhpScoper5b6804f9734c8\\GuzzleHttp\\Handler\\CurlMultiHandler' => $vendorDir . '/guzzlehttp/guzzle/src/Handler/CurlMultiHandler.php',
83
- '_PhpScoper5b6804f9734c8\\GuzzleHttp\\Handler\\EasyHandle' => $vendorDir . '/guzzlehttp/guzzle/src/Handler/EasyHandle.php',
84
- '_PhpScoper5b6804f9734c8\\GuzzleHttp\\Handler\\MockHandler' => $vendorDir . '/guzzlehttp/guzzle/src/Handler/MockHandler.php',
85
- '_PhpScoper5b6804f9734c8\\GuzzleHttp\\Handler\\Proxy' => $vendorDir . '/guzzlehttp/guzzle/src/Handler/Proxy.php',
86
- '_PhpScoper5b6804f9734c8\\GuzzleHttp\\Handler\\StreamHandler' => $vendorDir . '/guzzlehttp/guzzle/src/Handler/StreamHandler.php',
87
- '_PhpScoper5b6804f9734c8\\GuzzleHttp\\MessageFormatter' => $vendorDir . '/guzzlehttp/guzzle/src/MessageFormatter.php',
88
- '_PhpScoper5b6804f9734c8\\GuzzleHttp\\Middleware' => $vendorDir . '/guzzlehttp/guzzle/src/Middleware.php',
89
- '_PhpScoper5b6804f9734c8\\GuzzleHttp\\Pool' => $vendorDir . '/guzzlehttp/guzzle/src/Pool.php',
90
- '_PhpScoper5b6804f9734c8\\GuzzleHttp\\PrepareBodyMiddleware' => $vendorDir . '/guzzlehttp/guzzle/src/PrepareBodyMiddleware.php',
91
- '_PhpScoper5b6804f9734c8\\GuzzleHttp\\Promise\\AggregateException' => $vendorDir . '/guzzlehttp/promises/src/AggregateException.php',
92
- '_PhpScoper5b6804f9734c8\\GuzzleHttp\\Promise\\CancellationException' => $vendorDir . '/guzzlehttp/promises/src/CancellationException.php',
93
- '_PhpScoper5b6804f9734c8\\GuzzleHttp\\Promise\\Coroutine' => $vendorDir . '/guzzlehttp/promises/src/Coroutine.php',
94
- '_PhpScoper5b6804f9734c8\\GuzzleHttp\\Promise\\EachPromise' => $vendorDir . '/guzzlehttp/promises/src/EachPromise.php',
95
- '_PhpScoper5b6804f9734c8\\GuzzleHttp\\Promise\\FulfilledPromise' => $vendorDir . '/guzzlehttp/promises/src/FulfilledPromise.php',
96
- '_PhpScoper5b6804f9734c8\\GuzzleHttp\\Promise\\Promise' => $vendorDir . '/guzzlehttp/promises/src/Promise.php',
97
- '_PhpScoper5b6804f9734c8\\GuzzleHttp\\Promise\\PromiseInterface' => $vendorDir . '/guzzlehttp/promises/src/PromiseInterface.php',
98
- '_PhpScoper5b6804f9734c8\\GuzzleHttp\\Promise\\PromisorInterface' => $vendorDir . '/guzzlehttp/promises/src/PromisorInterface.php',
99
- '_PhpScoper5b6804f9734c8\\GuzzleHttp\\Promise\\RejectedPromise' => $vendorDir . '/guzzlehttp/promises/src/RejectedPromise.php',
100
- '_PhpScoper5b6804f9734c8\\GuzzleHttp\\Promise\\RejectionException' => $vendorDir . '/guzzlehttp/promises/src/RejectionException.php',
101
- '_PhpScoper5b6804f9734c8\\GuzzleHttp\\Promise\\TaskQueue' => $vendorDir . '/guzzlehttp/promises/src/TaskQueue.php',
102
- '_PhpScoper5b6804f9734c8\\GuzzleHttp\\Promise\\TaskQueueInterface' => $vendorDir . '/guzzlehttp/promises/src/TaskQueueInterface.php',
103
- '_PhpScoper5b6804f9734c8\\GuzzleHttp\\Psr7\\AppendStream' => $vendorDir . '/guzzlehttp/psr7/src/AppendStream.php',
104
- '_PhpScoper5b6804f9734c8\\GuzzleHttp\\Psr7\\BufferStream' => $vendorDir . '/guzzlehttp/psr7/src/BufferStream.php',
105
- '_PhpScoper5b6804f9734c8\\GuzzleHttp\\Psr7\\CachingStream' => $vendorDir . '/guzzlehttp/psr7/src/CachingStream.php',
106
- '_PhpScoper5b6804f9734c8\\GuzzleHttp\\Psr7\\DroppingStream' => $vendorDir . '/guzzlehttp/psr7/src/DroppingStream.php',
107
- '_PhpScoper5b6804f9734c8\\GuzzleHttp\\Psr7\\FnStream' => $vendorDir . '/guzzlehttp/psr7/src/FnStream.php',
108
- '_PhpScoper5b6804f9734c8\\GuzzleHttp\\Psr7\\InflateStream' => $vendorDir . '/guzzlehttp/psr7/src/InflateStream.php',
109
- '_PhpScoper5b6804f9734c8\\GuzzleHttp\\Psr7\\LazyOpenStream' => $vendorDir . '/guzzlehttp/psr7/src/LazyOpenStream.php',
110
- '_PhpScoper5b6804f9734c8\\GuzzleHttp\\Psr7\\LimitStream' => $vendorDir . '/guzzlehttp/psr7/src/LimitStream.php',
111
- '_PhpScoper5b6804f9734c8\\GuzzleHttp\\Psr7\\MessageTrait' => $vendorDir . '/guzzlehttp/psr7/src/MessageTrait.php',
112
- '_PhpScoper5b6804f9734c8\\GuzzleHttp\\Psr7\\MultipartStream' => $vendorDir . '/guzzlehttp/psr7/src/MultipartStream.php',
113
- '_PhpScoper5b6804f9734c8\\GuzzleHttp\\Psr7\\NoSeekStream' => $vendorDir . '/guzzlehttp/psr7/src/NoSeekStream.php',
114
- '_PhpScoper5b6804f9734c8\\GuzzleHttp\\Psr7\\PumpStream' => $vendorDir . '/guzzlehttp/psr7/src/PumpStream.php',
115
- '_PhpScoper5b6804f9734c8\\GuzzleHttp\\Psr7\\Request' => $vendorDir . '/guzzlehttp/psr7/src/Request.php',
116
- '_PhpScoper5b6804f9734c8\\GuzzleHttp\\Psr7\\Response' => $vendorDir . '/guzzlehttp/psr7/src/Response.php',
117
- '_PhpScoper5b6804f9734c8\\GuzzleHttp\\Psr7\\ServerRequest' => $vendorDir . '/guzzlehttp/psr7/src/ServerRequest.php',
118
- '_PhpScoper5b6804f9734c8\\GuzzleHttp\\Psr7\\Stream' => $vendorDir . '/guzzlehttp/psr7/src/Stream.php',
119
- '_PhpScoper5b6804f9734c8\\GuzzleHttp\\Psr7\\StreamDecoratorTrait' => $vendorDir . '/guzzlehttp/psr7/src/StreamDecoratorTrait.php',
120
- '_PhpScoper5b6804f9734c8\\GuzzleHttp\\Psr7\\StreamWrapper' => $vendorDir . '/guzzlehttp/psr7/src/StreamWrapper.php',
121
- '_PhpScoper5b6804f9734c8\\GuzzleHttp\\Psr7\\UploadedFile' => $vendorDir . '/guzzlehttp/psr7/src/UploadedFile.php',
122
- '_PhpScoper5b6804f9734c8\\GuzzleHttp\\Psr7\\Uri' => $vendorDir . '/guzzlehttp/psr7/src/Uri.php',
123
- '_PhpScoper5b6804f9734c8\\GuzzleHttp\\Psr7\\UriNormalizer' => $vendorDir . '/guzzlehttp/psr7/src/UriNormalizer.php',
124
- '_PhpScoper5b6804f9734c8\\GuzzleHttp\\Psr7\\UriResolver' => $vendorDir . '/guzzlehttp/psr7/src/UriResolver.php',
125
- '_PhpScoper5b6804f9734c8\\GuzzleHttp\\RedirectMiddleware' => $vendorDir . '/guzzlehttp/guzzle/src/RedirectMiddleware.php',
126
- '_PhpScoper5b6804f9734c8\\GuzzleHttp\\RequestOptions' => $vendorDir . '/guzzlehttp/guzzle/src/RequestOptions.php',
127
- '_PhpScoper5b6804f9734c8\\GuzzleHttp\\RetryMiddleware' => $vendorDir . '/guzzlehttp/guzzle/src/RetryMiddleware.php',
128
- '_PhpScoper5b6804f9734c8\\GuzzleHttp\\TransferStats' => $vendorDir . '/guzzlehttp/guzzle/src/TransferStats.php',
129
- '_PhpScoper5b6804f9734c8\\GuzzleHttp\\UriTemplate' => $vendorDir . '/guzzlehttp/guzzle/src/UriTemplate.php',
130
- '_PhpScoper5b6804f9734c8\\Psr\\Http\\Message\\MessageInterface' => $vendorDir . '/psr/http-message/src/MessageInterface.php',
131
- '_PhpScoper5b6804f9734c8\\Psr\\Http\\Message\\RequestInterface' => $vendorDir . '/psr/http-message/src/RequestInterface.php',
132
- '_PhpScoper5b6804f9734c8\\Psr\\Http\\Message\\ResponseInterface' => $vendorDir . '/psr/http-message/src/ResponseInterface.php',
133
- '_PhpScoper5b6804f9734c8\\Psr\\Http\\Message\\ServerRequestInterface' => $vendorDir . '/psr/http-message/src/ServerRequestInterface.php',
134
- '_PhpScoper5b6804f9734c8\\Psr\\Http\\Message\\StreamInterface' => $vendorDir . '/psr/http-message/src/StreamInterface.php',
135
- '_PhpScoper5b6804f9734c8\\Psr\\Http\\Message\\UploadedFileInterface' => $vendorDir . '/psr/http-message/src/UploadedFileInterface.php',
136
- '_PhpScoper5b6804f9734c8\\Psr\\Http\\Message\\UriInterface' => $vendorDir . '/psr/http-message/src/UriInterface.php',
137
- '_PhpScoper5b6804f9734c8\\Tests\\Mollie\\Api\\CompatibilityCheckerTest' => $baseDir . '/tests/Mollie/API/CompatibilityCheckerTest.php',
138
- '_PhpScoper5b6804f9734c8\\Tests\\Mollie\\Api\\Endpoints\\BaseEndpointTest' => $baseDir . '/tests/Mollie/API/Endpoints/BaseEndpointTest.php',
139
- '_PhpScoper5b6804f9734c8\\Tests\\Mollie\\Api\\Endpoints\\ChargebackEndpointTest' => $baseDir . '/tests/Mollie/API/Endpoints/ChargebackEndpointTest.php',
140
- '_PhpScoper5b6804f9734c8\\Tests\\Mollie\\Api\\Endpoints\\CustomerEndpointTest' => $baseDir . '/tests/Mollie/API/Endpoints/CustomerEndpointTest.php',
141
- '_PhpScoper5b6804f9734c8\\Tests\\Mollie\\Api\\Endpoints\\CustomerPaymentEndpointTest' => $baseDir . '/tests/Mollie/API/Endpoints/CustomerPaymentEndpointTest.php',
142
- '_PhpScoper5b6804f9734c8\\Tests\\Mollie\\Api\\Endpoints\\InvoiceEndpointTest' => $baseDir . '/tests/Mollie/API/Endpoints/InvoiceEndpointTest.php',
143
- '_PhpScoper5b6804f9734c8\\Tests\\Mollie\\Api\\Endpoints\\MandateEndpointTest' => $baseDir . '/tests/Mollie/API/Endpoints/MandateEndpointTest.php',
144
- '_PhpScoper5b6804f9734c8\\Tests\\Mollie\\Api\\Endpoints\\MethodEndpointTest' => $baseDir . '/tests/Mollie/API/Endpoints/MethodEndpointTest.php',
145
- '_PhpScoper5b6804f9734c8\\Tests\\Mollie\\Api\\Endpoints\\PaymentEndpointTest' => $baseDir . '/tests/Mollie/API/Endpoints/PaymentEndpointTest.php',
146
- '_PhpScoper5b6804f9734c8\\Tests\\Mollie\\Api\\Endpoints\\PaymentRefundEndpointTest' => $baseDir . '/tests/Mollie/API/Endpoints/PaymentRefundEndpointTest.php',
147
- '_PhpScoper5b6804f9734c8\\Tests\\Mollie\\Api\\Endpoints\\ProfileEndpointTest' => $baseDir . '/tests/Mollie/API/Endpoints/ProfileEndpointTest.php',
148
- '_PhpScoper5b6804f9734c8\\Tests\\Mollie\\Api\\Endpoints\\RefundEndpointTest' => $baseDir . '/tests/Mollie/API/Endpoints/RefundEndpointTest.php',
149
- '_PhpScoper5b6804f9734c8\\Tests\\Mollie\\Api\\Endpoints\\SettlementEndpointTest' => $baseDir . '/tests/Mollie/API/Endpoints/SettlementEndpointTest.php',
150
- '_PhpScoper5b6804f9734c8\\Tests\\Mollie\\Api\\Endpoints\\SubscriptionEndpointTest' => $baseDir . '/tests/Mollie/API/Endpoints/SubscriptionEndpointTest.php',
151
- '_PhpScoper5b6804f9734c8\\Tests\\Mollie\\Api\\MollieApiClientTest' => $baseDir . '/tests/Mollie/API/MollieApiClientTest.php',
152
- '_PhpScoper5b6804f9734c8\\Tests\\Mollie\\Api\\Resources\\InvoiceTest' => $baseDir . '/tests/Mollie/API/Resources/InvoiceTest.php',
153
- '_PhpScoper5b6804f9734c8\\Tests\\Mollie\\Api\\Resources\\PaymentTest' => $baseDir . '/tests/Mollie/API/Resources/PaymentTest.php',
154
- '_PhpScoper5b6804f9734c8\\Tests\\Mollie\\Api\\Resources\\ProfileTest' => $baseDir . '/tests/Mollie/API/Resources/ProfileTest.php',
155
- '_PhpScoper5b6804f9734c8\\Tests\\Mollie\\Api\\Resources\\RefundTest' => $baseDir . '/tests/Mollie/API/Resources/RefundTest.php',
156
- '_PhpScoper5b6804f9734c8\\Tests\\Mollie\\Api\\Resources\\ResourceFactoryTest' => $baseDir . '/tests/Mollie/API/Resources/ResourceFactoryTest.php',
157
- '_PhpScoper5b6804f9734c8\\Tests\\Mollie\\Api\\Resources\\SettlementTest' => $baseDir . '/tests/Mollie/API/Resources/SettlementTest.php',
158
- '_PhpScoper5b6804f9734c8\\Tests\\Mollie\\Api\\Resources\\SubscriptionTest' => $baseDir . '/tests/Mollie/API/Resources/SubscriptionTest.php',
159
  );
6
  $baseDir = dirname($vendorDir);
7
 
8
  return array(
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
9
  );
includes/mollie-api-php/vendor/composer/autoload_psr4.php CHANGED
@@ -6,11 +6,10 @@ $vendorDir = dirname(dirname(__FILE__));
6
  $baseDir = dirname($vendorDir);
7
 
8
  return array(
9
- '_PhpScoper5b6804f9734c8\\Tests\\' => array($baseDir . '/tests'),
10
- '_PhpScoper5b6804f9734c8\\Psr\\Http\\Message\\' => array($vendorDir . '/psr/http-message/src'),
11
- '_PhpScoper5b6804f9734c8\\GuzzleHttp\\Psr7\\' => array($vendorDir . '/guzzlehttp/psr7/src'),
12
- '_PhpScoper5b6804f9734c8\\GuzzleHttp\\Promise\\' => array($vendorDir . '/guzzlehttp/promises/src'),
13
- '_PhpScoper5b6804f9734c8\\GuzzleHttp\\' => array($vendorDir . '/guzzlehttp/guzzle/src'),
14
- '_PhpScoper5b6804f9734c8\\Composer\\CaBundle\\' => array($vendorDir . '/composer/ca-bundle/src'),
15
  'Mollie\\Api\\' => array($baseDir . '/src'),
 
 
 
 
16
  );
6
  $baseDir = dirname($vendorDir);
7
 
8
  return array(
9
+ 'Psr\\Http\\Message\\' => array($vendorDir . '/psr/http-message/src'),
 
 
 
 
 
10
  'Mollie\\Api\\' => array($baseDir . '/src'),
11
+ 'GuzzleHttp\\Psr7\\' => array($vendorDir . '/guzzlehttp/psr7/src'),
12
+ 'GuzzleHttp\\Promise\\' => array($vendorDir . '/guzzlehttp/promises/src'),
13
+ 'GuzzleHttp\\' => array($vendorDir . '/guzzlehttp/guzzle/src'),
14
+ 'Composer\\CaBundle\\' => array($vendorDir . '/composer/ca-bundle/src'),
15
  );
includes/mollie-api-php/vendor/composer/autoload_real.php CHANGED
@@ -2,7 +2,7 @@
2
 
3
  // autoload_real.php @generated by Composer
4
 
5
- class ComposerAutoloaderInit4062f91c07f6f2ba911ecd0f0813a468
6
  {
7
  private static $loader;
8
 
@@ -19,39 +19,48 @@ class ComposerAutoloaderInit4062f91c07f6f2ba911ecd0f0813a468
19
  return self::$loader;
20
  }
21
 
22
- spl_autoload_register(array('ComposerAutoloaderInit4062f91c07f6f2ba911ecd0f0813a468', 'loadClassLoader'), true, true);
23
  self::$loader = $loader = new \Composer\Autoload\ClassLoader();
24
- spl_autoload_unregister(array('ComposerAutoloaderInit4062f91c07f6f2ba911ecd0f0813a468', 'loadClassLoader'));
25
 
26
  $useStaticLoader = PHP_VERSION_ID >= 50600 && !defined('HHVM_VERSION') && (!function_exists('zend_loader_file_encoded') || !zend_loader_file_encoded());
27
  if ($useStaticLoader) {
28
  require_once __DIR__ . '/autoload_static.php';
29
 
30
- call_user_func(\Composer\Autoload\ComposerStaticInit4062f91c07f6f2ba911ecd0f0813a468::getInitializer($loader));
31
  } else {
 
 
 
 
 
 
 
 
 
 
32
  $classMap = require __DIR__ . '/autoload_classmap.php';
33
  if ($classMap) {
34
  $loader->addClassMap($classMap);
35
  }
36
  }
37
 
38
- $loader->setClassMapAuthoritative(true);
39
  $loader->register(true);
40
 
41
  if ($useStaticLoader) {
42
- $includeFiles = Composer\Autoload\ComposerStaticInit4062f91c07f6f2ba911ecd0f0813a468::$files;
43
  } else {
44
  $includeFiles = require __DIR__ . '/autoload_files.php';
45
  }
46
  foreach ($includeFiles as $fileIdentifier => $file) {
47
- composerRequire4062f91c07f6f2ba911ecd0f0813a468($fileIdentifier, $file);
48
  }
49
 
50
  return $loader;
51
  }
52
  }
53
 
54
- function composerRequire4062f91c07f6f2ba911ecd0f0813a468($fileIdentifier, $file)
55
  {
56
  if (empty($GLOBALS['__composer_autoload_files'][$fileIdentifier])) {
57
  require $file;
2
 
3
  // autoload_real.php @generated by Composer
4
 
5
+ class ComposerAutoloaderInitf1d08e70f69871d38ce5b109d41f0cad
6
  {
7
  private static $loader;
8
 
19
  return self::$loader;
20
  }
21
 
22
+ spl_autoload_register(array('ComposerAutoloaderInitf1d08e70f69871d38ce5b109d41f0cad', 'loadClassLoader'), true, true);
23
  self::$loader = $loader = new \Composer\Autoload\ClassLoader();
24
+ spl_autoload_unregister(array('ComposerAutoloaderInitf1d08e70f69871d38ce5b109d41f0cad', 'loadClassLoader'));
25
 
26
  $useStaticLoader = PHP_VERSION_ID >= 50600 && !defined('HHVM_VERSION') && (!function_exists('zend_loader_file_encoded') || !zend_loader_file_encoded());
27
  if ($useStaticLoader) {
28
  require_once __DIR__ . '/autoload_static.php';
29
 
30
+ call_user_func(\Composer\Autoload\ComposerStaticInitf1d08e70f69871d38ce5b109d41f0cad::getInitializer($loader));
31
  } else {
32
+ $map = require __DIR__ . '/autoload_namespaces.php';
33
+ foreach ($map as $namespace => $path) {
34
+ $loader->set($namespace, $path);
35
+ }
36
+
37
+ $map = require __DIR__ . '/autoload_psr4.php';
38
+ foreach ($map as $namespace => $path) {
39
+ $loader->setPsr4($namespace, $path);
40
+ }
41
+
42
  $classMap = require __DIR__ . '/autoload_classmap.php';
43
  if ($classMap) {
44
  $loader->addClassMap($classMap);
45
  }
46
  }
47
 
 
48
  $loader->register(true);
49
 
50
  if ($useStaticLoader) {
51
+ $includeFiles = Composer\Autoload\ComposerStaticInitf1d08e70f69871d38ce5b109d41f0cad::$files;
52
  } else {
53
  $includeFiles = require __DIR__ . '/autoload_files.php';
54
  }
55
  foreach ($includeFiles as $fileIdentifier => $file) {
56
+ composerRequiref1d08e70f69871d38ce5b109d41f0cad($fileIdentifier, $file);
57
  }
58
 
59
  return $loader;
60
  }
61
  }
62
 
63
+ function composerRequiref1d08e70f69871d38ce5b109d41f0cad($fileIdentifier, $file)
64
  {
65
  if (empty($GLOBALS['__composer_autoload_files'][$fileIdentifier])) {
66
  require $file;
includes/mollie-api-php/vendor/composer/autoload_static.php CHANGED
@@ -4,7 +4,7 @@
4
 
5
  namespace Composer\Autoload;
6
 
7
- class ComposerStaticInit4062f91c07f6f2ba911ecd0f0813a468
8
  {
9
  public static $files = array (
10
  'c964ee0ededf28c96ebd9db5099ef910' => __DIR__ . '/..' . '/guzzlehttp/promises/src/functions_include.php',
@@ -13,211 +13,58 @@ class ComposerStaticInit4062f91c07f6f2ba911ecd0f0813a468
13
  );
14
 
15
  public static $prefixLengthsPsr4 = array (
16
- '_' =>
17
  array (
18
- '_PhpScoper5b6804f9734c8\\Tests\\' => 30,
19
- '_PhpScoper5b6804f9734c8\\Psr\\Http\\Message\\' => 41,
20
- '_PhpScoper5b6804f9734c8\\GuzzleHttp\\Psr7\\' => 40,
21
- '_PhpScoper5b6804f9734c8\\GuzzleHttp\\Promise\\' => 43,
22
- '_PhpScoper5b6804f9734c8\\GuzzleHttp\\' => 35,
23
- '_PhpScoper5b6804f9734c8\\Composer\\CaBundle\\' => 42,
24
  ),
25
  'M' =>
26
  array (
27
  'Mollie\\Api\\' => 11,
28
  ),
 
 
 
 
 
 
 
 
 
 
29
  );
30
 
31
  public static $prefixDirsPsr4 = array (
32
- '_PhpScoper5b6804f9734c8\\Tests\\' =>
33
  array (
34
- 0 => __DIR__ . '/../..' . '/tests',
35
  ),
36
- '_PhpScoper5b6804f9734c8\\Psr\\Http\\Message\\' =>
37
  array (
38
- 0 => __DIR__ . '/..' . '/psr/http-message/src',
39
  ),
40
- '_PhpScoper5b6804f9734c8\\GuzzleHttp\\Psr7\\' =>
41
  array (
42
  0 => __DIR__ . '/..' . '/guzzlehttp/psr7/src',
43
  ),
44
- '_PhpScoper5b6804f9734c8\\GuzzleHttp\\Promise\\' =>
45
  array (
46
  0 => __DIR__ . '/..' . '/guzzlehttp/promises/src',
47
  ),
48
- '_PhpScoper5b6804f9734c8\\GuzzleHttp\\' =>
49
  array (
50
  0 => __DIR__ . '/..' . '/guzzlehttp/guzzle/src',
51
  ),
52
- '_PhpScoper5b6804f9734c8\\Composer\\CaBundle\\' =>
53
  array (
54
  0 => __DIR__ . '/..' . '/composer/ca-bundle/src',
55
  ),
56
- 'Mollie\\Api\\' =>
57
- array (
58
- 0 => __DIR__ . '/../..' . '/src',
59
- ),
60
- );
61
-
62
- public static $classMap = array (
63
- 'Mollie\\Api\\CompatibilityChecker' => __DIR__ . '/../..' . '/src/CompatibilityChecker.php',
64
- 'Mollie\\Api\\Endpoints\\CustomerEndpoint' => __DIR__ . '/../..' . '/src/Endpoints/CustomerEndpoint.php',
65
- 'Mollie\\Api\\Endpoints\\CustomerPaymentsEndpoint' => __DIR__ . '/../..' . '/src/Endpoints/CustomerPaymentsEndpoint.php',
66
- 'Mollie\\Api\\Endpoints\\EndpointAbstract' => __DIR__ . '/../..' . '/src/Endpoints/EndpointAbstract.php',
67
- 'Mollie\\Api\\Endpoints\\InvoiceEndpoint' => __DIR__ . '/../..' . '/src/Endpoints/InvoiceEndpoint.php',
68
- 'Mollie\\Api\\Endpoints\\MandateEndpoint' => __DIR__ . '/../..' . '/src/Endpoints/MandateEndpoint.php',
69
- 'Mollie\\Api\\Endpoints\\MethodEndpoint' => __DIR__ . '/../..' . '/src/Endpoints/MethodEndpoint.php',
70
- 'Mollie\\Api\\Endpoints\\PaymentEndpoint' => __DIR__ . '/../..' . '/src/Endpoints/PaymentEndpoint.php',
71
- 'Mollie\\Api\\Endpoints\\PaymentRefundEndpoint' => __DIR__ . '/../..' . '/src/Endpoints/PaymentRefundEndpoint.php',
72
- 'Mollie\\Api\\Endpoints\\ProfileEndpoint' => __DIR__ . '/../..' . '/src/Endpoints/ProfileEndpoint.php',
73
- 'Mollie\\Api\\Endpoints\\RefundEndpoint' => __DIR__ . '/../..' . '/src/Endpoints/RefundEndpoint.php',
74
- 'Mollie\\Api\\Endpoints\\SettlementsEndpoint' => __DIR__ . '/../..' . '/src/Endpoints/SettlementsEndpoint.php',
75
- 'Mollie\\Api\\Endpoints\\SubscriptionEndpoint' => __DIR__ . '/../..' . '/src/Endpoints/SubscriptionEndpoint.php',
76
- 'Mollie\\Api\\Exceptions\\ApiException' => __DIR__ . '/../..' . '/src/Exceptions/ApiException.php',
77
- 'Mollie\\Api\\Exceptions\\IncompatiblePlatform' => __DIR__ . '/../..' . '/src/Exceptions/IncompatiblePlatform.php',
78
- 'Mollie\\Api\\MollieApiClient' => __DIR__ . '/../..' . '/src/MollieApiClient.php',
79
- 'Mollie\\Api\\Resources\\BaseCollection' => __DIR__ . '/../..' . '/src/Resources/BaseCollection.php',
80
- 'Mollie\\Api\\Resources\\BaseResource' => __DIR__ . '/../..' . '/src/Resources/BaseResource.php',
81
- 'Mollie\\Api\\Resources\\Chargeback' => __DIR__ . '/../..' . '/src/Resources/Chargeback.php',
82
- 'Mollie\\Api\\Resources\\ChargebackCollection' => __DIR__ . '/../..' . '/src/Resources/ChargebackCollection.php',
83
- 'Mollie\\Api\\Resources\\CursorCollection' => __DIR__ . '/../..' . '/src/Resources/CursorCollection.php',
84
- 'Mollie\\Api\\Resources\\Customer' => __DIR__ . '/../..' . '/src/Resources/Customer.php',
85
- 'Mollie\\Api\\Resources\\CustomerCollection' => __DIR__ . '/../..' . '/src/Resources/CustomerCollection.php',
86
- 'Mollie\\Api\\Resources\\Invoice' => __DIR__ . '/../..' . '/src/Resources/Invoice.php',
87
- 'Mollie\\Api\\Resources\\InvoiceCollection' => __DIR__ . '/../..' . '/src/Resources/InvoiceCollection.php',
88
- 'Mollie\\Api\\Resources\\Issuer' => __DIR__ . '/../..' . '/src/Resources/Issuer.php',
89
- 'Mollie\\Api\\Resources\\IssuerCollection' => __DIR__ . '/../..' . '/src/Resources/IssuerCollection.php',
90
- 'Mollie\\Api\\Resources\\Mandate' => __DIR__ . '/../..' . '/src/Resources/Mandate.php',
91
- 'Mollie\\Api\\Resources\\MandateCollection' => __DIR__ . '/../..' . '/src/Resources/MandateCollection.php',
92
- 'Mollie\\Api\\Resources\\Method' => __DIR__ . '/../..' . '/src/Resources/Method.php',
93
- 'Mollie\\Api\\Resources\\MethodCollection' => __DIR__ . '/../..' . '/src/Resources/MethodCollection.php',
94
- 'Mollie\\Api\\Resources\\Payment' => __DIR__ . '/../..' . '/src/Resources/Payment.php',
95
- 'Mollie\\Api\\Resources\\PaymentCollection' => __DIR__ . '/../..' . '/src/Resources/PaymentCollection.php',
96
- 'Mollie\\Api\\Resources\\Profile' => __DIR__ . '/../..' . '/src/Resources/Profile.php',
97
- 'Mollie\\Api\\Resources\\ProfileCollection' => __DIR__ . '/../..' . '/src/Resources/ProfileCollection.php',
98
- 'Mollie\\Api\\Resources\\Refund' => __DIR__ . '/../..' . '/src/Resources/Refund.php',
99
- 'Mollie\\Api\\Resources\\RefundCollection' => __DIR__ . '/../..' . '/src/Resources/RefundCollection.php',
100
- 'Mollie\\Api\\Resources\\ResourceFactory' => __DIR__ . '/../..' . '/src/Resources/ResourceFactory.php',
101
- 'Mollie\\Api\\Resources\\Settlement' => __DIR__ . '/../..' . '/src/Resources/Settlement.php',
102
- 'Mollie\\Api\\Resources\\SettlementCollection' => __DIR__ . '/../..' . '/src/Resources/SettlementCollection.php',
103
- 'Mollie\\Api\\Resources\\Subscription' => __DIR__ . '/../..' . '/src/Resources/Subscription.php',
104
- 'Mollie\\Api\\Resources\\SubscriptionCollection' => __DIR__ . '/../..' . '/src/Resources/SubscriptionCollection.php',
105
- 'Mollie\\Api\\Types\\InvoiceStatus' => __DIR__ . '/../..' . '/src/Types/InvoiceStatus.php',
106
- 'Mollie\\Api\\Types\\MandateMethod' => __DIR__ . '/../..' . '/src/Types/MandateMethod.php',
107
- 'Mollie\\Api\\Types\\MandateStatus' => __DIR__ . '/../..' . '/src/Types/MandateStatus.php',
108
- 'Mollie\\Api\\Types\\PaymentMethod' => __DIR__ . '/../..' . '/src/Types/PaymentMethod.php',
109
- 'Mollie\\Api\\Types\\PaymentStatus' => __DIR__ . '/../..' . '/src/Types/PaymentStatus.php',
110
- 'Mollie\\Api\\Types\\ProfileStatus' => __DIR__ . '/../..' . '/src/Types/ProfileStatus.php',
111
- 'Mollie\\Api\\Types\\RefundStatus' => __DIR__ . '/../..' . '/src/Types/RefundStatus.php',
112
- 'Mollie\\Api\\Types\\SequenceType' => __DIR__ . '/../..' . '/src/Types/SequenceType.php',
113
- 'Mollie\\Api\\Types\\SettlementStatus' => __DIR__ . '/../..' . '/src/Types/SettlementStatus.php',
114
- 'Mollie\\Api\\Types\\SubscriptionStatus' => __DIR__ . '/../..' . '/src/Types/SubscriptionStatus.php',
115
- '_PhpScoper5b6804f9734c8\\Composer\\CaBundle\\CaBundle' => __DIR__ . '/..' . '/composer/ca-bundle/src/CaBundle.php',
116
- '_PhpScoper5b6804f9734c8\\GuzzleHttp\\Client' => __DIR__ . '/..' . '/guzzlehttp/guzzle/src/Client.php',
117
- '_PhpScoper5b6804f9734c8\\GuzzleHttp\\ClientInterface' => __DIR__ . '/..' . '/guzzlehttp/guzzle/src/ClientInterface.php',
118
- '_PhpScoper5b6804f9734c8\\GuzzleHttp\\Cookie\\CookieJar' => __DIR__ . '/..' . '/guzzlehttp/guzzle/src/Cookie/CookieJar.php',
119
- '_PhpScoper5b6804f9734c8\\GuzzleHttp\\Cookie\\CookieJarInterface' => __DIR__ . '/..' . '/guzzlehttp/guzzle/src/Cookie/CookieJarInterface.php',
120
- '_PhpScoper5b6804f9734c8\\GuzzleHttp\\Cookie\\FileCookieJar' => __DIR__ . '/..' . '/guzzlehttp/guzzle/src/Cookie/FileCookieJar.php',
121
- '_PhpScoper5b6804f9734c8\\GuzzleHttp\\Cookie\\SessionCookieJar' => __DIR__ . '/..' . '/guzzlehttp/guzzle/src/Cookie/SessionCookieJar.php',
122
- '_PhpScoper5b6804f9734c8\\GuzzleHttp\\Cookie\\SetCookie' => __DIR__ . '/..' . '/guzzlehttp/guzzle/src/Cookie/SetCookie.php',
123
- '_PhpScoper5b6804f9734c8\\GuzzleHttp\\Exception\\BadResponseException' => __DIR__ . '/..' . '/guzzlehttp/guzzle/src/Exception/BadResponseException.php',
124
- '_PhpScoper5b6804f9734c8\\GuzzleHttp\\Exception\\ClientException' => __DIR__ . '/..' . '/guzzlehttp/guzzle/src/Exception/ClientException.php',
125
- '_PhpScoper5b6804f9734c8\\GuzzleHttp\\Exception\\ConnectException' => __DIR__ . '/..' . '/guzzlehttp/guzzle/src/Exception/ConnectException.php',
126
- '_PhpScoper5b6804f9734c8\\GuzzleHttp\\Exception\\GuzzleException' => __DIR__ . '/..' . '/guzzlehttp/guzzle/src/Exception/GuzzleException.php',
127
- '_PhpScoper5b6804f9734c8\\GuzzleHttp\\Exception\\RequestException' => __DIR__ . '/..' . '/guzzlehttp/guzzle/src/Exception/RequestException.php',
128
- '_PhpScoper5b6804f9734c8\\GuzzleHttp\\Exception\\SeekException' => __DIR__ . '/..' . '/guzzlehttp/guzzle/src/Exception/SeekException.php',
129
- '_PhpScoper5b6804f9734c8\\GuzzleHttp\\Exception\\ServerException' => __DIR__ . '/..' . '/guzzlehttp/guzzle/src/Exception/ServerException.php',
130
- '_PhpScoper5b6804f9734c8\\GuzzleHttp\\Exception\\TooManyRedirectsException' => __DIR__ . '/..' . '/guzzlehttp/guzzle/src/Exception/TooManyRedirectsException.php',
131
- '_PhpScoper5b6804f9734c8\\GuzzleHttp\\Exception\\TransferException' => __DIR__ . '/..' . '/guzzlehttp/guzzle/src/Exception/TransferException.php',
132
- '_PhpScoper5b6804f9734c8\\GuzzleHttp\\HandlerStack' => __DIR__ . '/..' . '/guzzlehttp/guzzle/src/HandlerStack.php',
133
- '_PhpScoper5b6804f9734c8\\GuzzleHttp\\Handler\\CurlFactory' => __DIR__ . '/..' . '/guzzlehttp/guzzle/src/Handler/CurlFactory.php',
134
- '_PhpScoper5b6804f9734c8\\GuzzleHttp\\Handler\\CurlFactoryInterface' => __DIR__ . '/..' . '/guzzlehttp/guzzle/src/Handler/CurlFactoryInterface.php',
135
- '_PhpScoper5b6804f9734c8\\GuzzleHttp\\Handler\\CurlHandler' => __DIR__ . '/..' . '/guzzlehttp/guzzle/src/Handler/CurlHandler.php',
136
- '_PhpScoper5b6804f9734c8\\GuzzleHttp\\Handler\\CurlMultiHandler' => __DIR__ . '/..' . '/guzzlehttp/guzzle/src/Handler/CurlMultiHandler.php',
137
- '_PhpScoper5b6804f9734c8\\GuzzleHttp\\Handler\\EasyHandle' => __DIR__ . '/..' . '/guzzlehttp/guzzle/src/Handler/EasyHandle.php',
138
- '_PhpScoper5b6804f9734c8\\GuzzleHttp\\Handler\\MockHandler' => __DIR__ . '/..' . '/guzzlehttp/guzzle/src/Handler/MockHandler.php',
139
- '_PhpScoper5b6804f9734c8\\GuzzleHttp\\Handler\\Proxy' => __DIR__ . '/..' . '/guzzlehttp/guzzle/src/Handler/Proxy.php',
140
- '_PhpScoper5b6804f9734c8\\GuzzleHttp\\Handler\\StreamHandler' => __DIR__ . '/..' . '/guzzlehttp/guzzle/src/Handler/StreamHandler.php',
141
- '_PhpScoper5b6804f9734c8\\GuzzleHttp\\MessageFormatter' => __DIR__ . '/..' . '/guzzlehttp/guzzle/src/MessageFormatter.php',
142
- '_PhpScoper5b6804f9734c8\\GuzzleHttp\\Middleware' => __DIR__ . '/..' . '/guzzlehttp/guzzle/src/Middleware.php',
143
- '_PhpScoper5b6804f9734c8\\GuzzleHttp\\Pool' => __DIR__ . '/..' . '/guzzlehttp/guzzle/src/Pool.php',
144
- '_PhpScoper5b6804f9734c8\\GuzzleHttp\\PrepareBodyMiddleware' => __DIR__ . '/..' . '/guzzlehttp/guzzle/src/PrepareBodyMiddleware.php',
145
- '_PhpScoper5b6804f9734c8\\GuzzleHttp\\Promise\\AggregateException' => __DIR__ . '/..' . '/guzzlehttp/promises/src/AggregateException.php',
146
- '_PhpScoper5b6804f9734c8\\GuzzleHttp\\Promise\\CancellationException' => __DIR__ . '/..' . '/guzzlehttp/promises/src/CancellationException.php',
147
- '_PhpScoper5b6804f9734c8\\GuzzleHttp\\Promise\\Coroutine' => __DIR__ . '/..' . '/guzzlehttp/promises/src/Coroutine.php',
148
- '_PhpScoper5b6804f9734c8\\GuzzleHttp\\Promise\\EachPromise' => __DIR__ . '/..' . '/guzzlehttp/promises/src/EachPromise.php',
149
- '_PhpScoper5b6804f9734c8\\GuzzleHttp\\Promise\\FulfilledPromise' => __DIR__ . '/..' . '/guzzlehttp/promises/src/FulfilledPromise.php',
150
- '_PhpScoper5b6804f9734c8\\GuzzleHttp\\Promise\\Promise' => __DIR__ . '/..' . '/guzzlehttp/promises/src/Promise.php',
151
- '_PhpScoper5b6804f9734c8\\GuzzleHttp\\Promise\\PromiseInterface' => __DIR__ . '/..' . '/guzzlehttp/promises/src/PromiseInterface.php',
152
- '_PhpScoper5b6804f9734c8\\GuzzleHttp\\Promise\\PromisorInterface' => __DIR__ . '/..' . '/guzzlehttp/promises/src/PromisorInterface.php',
153
- '_PhpScoper5b6804f9734c8\\GuzzleHttp\\Promise\\RejectedPromise' => __DIR__ . '/..' . '/guzzlehttp/promises/src/RejectedPromise.php',
154
- '_PhpScoper5b6804f9734c8\\GuzzleHttp\\Promise\\RejectionException' => __DIR__ . '/..' . '/guzzlehttp/promises/src/RejectionException.php',
155
- '_PhpScoper5b6804f9734c8\\GuzzleHttp\\Promise\\TaskQueue' => __DIR__ . '/..' . '/guzzlehttp/promises/src/TaskQueue.php',
156
- '_PhpScoper5b6804f9734c8\\GuzzleHttp\\Promise\\TaskQueueInterface' => __DIR__ . '/..' . '/guzzlehttp/promises/src/TaskQueueInterface.php',
157
- '_PhpScoper5b6804f9734c8\\GuzzleHttp\\Psr7\\AppendStream' => __DIR__ . '/..' . '/guzzlehttp/psr7/src/AppendStream.php',
158
- '_PhpScoper5b6804f9734c8\\GuzzleHttp\\Psr7\\BufferStream' => __DIR__ . '/..' . '/guzzlehttp/psr7/src/BufferStream.php',
159
- '_PhpScoper5b6804f9734c8\\GuzzleHttp\\Psr7\\CachingStream' => __DIR__ . '/..' . '/guzzlehttp/psr7/src/CachingStream.php',
160
- '_PhpScoper5b6804f9734c8\\GuzzleHttp\\Psr7\\DroppingStream' => __DIR__ . '/..' . '/guzzlehttp/psr7/src/DroppingStream.php',
161
- '_PhpScoper5b6804f9734c8\\GuzzleHttp\\Psr7\\FnStream' => __DIR__ . '/..' . '/guzzlehttp/psr7/src/FnStream.php',
162
- '_PhpScoper5b6804f9734c8\\GuzzleHttp\\Psr7\\InflateStream' => __DIR__ . '/..' . '/guzzlehttp/psr7/src/InflateStream.php',
163
- '_PhpScoper5b6804f9734c8\\GuzzleHttp\\Psr7\\LazyOpenStream' => __DIR__ . '/..' . '/guzzlehttp/psr7/src/LazyOpenStream.php',
164
- '_PhpScoper5b6804f9734c8\\GuzzleHttp\\Psr7\\LimitStream' => __DIR__ . '/..' . '/guzzlehttp/psr7/src/LimitStream.php',
165
- '_PhpScoper5b6804f9734c8\\GuzzleHttp\\Psr7\\MessageTrait' => __DIR__ . '/..' . '/guzzlehttp/psr7/src/MessageTrait.php',
166
- '_PhpScoper5b6804f9734c8\\GuzzleHttp\\Psr7\\MultipartStream' => __DIR__ . '/..' . '/guzzlehttp/psr7/src/MultipartStream.php',
167
- '_PhpScoper5b6804f9734c8\\GuzzleHttp\\Psr7\\NoSeekStream' => __DIR__ . '/..' . '/guzzlehttp/psr7/src/NoSeekStream.php',
168
- '_PhpScoper5b6804f9734c8\\GuzzleHttp\\Psr7\\PumpStream' => __DIR__ . '/..' . '/guzzlehttp/psr7/src/PumpStream.php',
169
- '_PhpScoper5b6804f9734c8\\GuzzleHttp\\Psr7\\Request' => __DIR__ . '/..' . '/guzzlehttp/psr7/src/Request.php',
170
- '_PhpScoper5b6804f9734c8\\GuzzleHttp\\Psr7\\Response' => __DIR__ . '/..' . '/guzzlehttp/psr7/src/Response.php',
171
- '_PhpScoper5b6804f9734c8\\GuzzleHttp\\Psr7\\ServerRequest' => __DIR__ . '/..' . '/guzzlehttp/psr7/src/ServerRequest.php',
172
- '_PhpScoper5b6804f9734c8\\GuzzleHttp\\Psr7\\Stream' => __DIR__ . '/..' . '/guzzlehttp/psr7/src/Stream.php',
173
- '_PhpScoper5b6804f9734c8\\GuzzleHttp\\Psr7\\StreamDecoratorTrait' => __DIR__ . '/..' . '/guzzlehttp/psr7/src/StreamDecoratorTrait.php',
174
- '_PhpScoper5b6804f9734c8\\GuzzleHttp\\Psr7\\StreamWrapper' => __DIR__ . '/..' . '/guzzlehttp/psr7/src/StreamWrapper.php',
175
- '_PhpScoper5b6804f9734c8\\GuzzleHttp\\Psr7\\UploadedFile' => __DIR__ . '/..' . '/guzzlehttp/psr7/src/UploadedFile.php',
176
- '_PhpScoper5b6804f9734c8\\GuzzleHttp\\Psr7\\Uri' => __DIR__ . '/..' . '/guzzlehttp/psr7/src/Uri.php',
177
- '_PhpScoper5b6804f9734c8\\GuzzleHttp\\Psr7\\UriNormalizer' => __DIR__ . '/..' . '/guzzlehttp/psr7/src/UriNormalizer.php',
178
- '_PhpScoper5b6804f9734c8\\GuzzleHttp\\Psr7\\UriResolver' => __DIR__ . '/..' . '/guzzlehttp/psr7/src/UriResolver.php',
179
- '_PhpScoper5b6804f9734c8\\GuzzleHttp\\RedirectMiddleware' => __DIR__ . '/..' . '/guzzlehttp/guzzle/src/RedirectMiddleware.php',
180
- '_PhpScoper5b6804f9734c8\\GuzzleHttp\\RequestOptions' => __DIR__ . '/..' . '/guzzlehttp/guzzle/src/RequestOptions.php',
181
- '_PhpScoper5b6804f9734c8\\GuzzleHttp\\RetryMiddleware' => __DIR__ . '/..' . '/guzzlehttp/guzzle/src/RetryMiddleware.php',
182
- '_PhpScoper5b6804f9734c8\\GuzzleHttp\\TransferStats' => __DIR__ . '/..' . '/guzzlehttp/guzzle/src/TransferStats.php',
183
- '_PhpScoper5b6804f9734c8\\GuzzleHttp\\UriTemplate' => __DIR__ . '/..' . '/guzzlehttp/guzzle/src/UriTemplate.php',
184
- '_PhpScoper5b6804f9734c8\\Psr\\Http\\Message\\MessageInterface' => __DIR__ . '/..' . '/psr/http-message/src/MessageInterface.php',
185
- '_PhpScoper5b6804f9734c8\\Psr\\Http\\Message\\RequestInterface' => __DIR__ . '/..' . '/psr/http-message/src/RequestInterface.php',
186
- '_PhpScoper5b6804f9734c8\\Psr\\Http\\Message\\ResponseInterface' => __DIR__ . '/..' . '/psr/http-message/src/ResponseInterface.php',
187
- '_PhpScoper5b6804f9734c8\\Psr\\Http\\Message\\ServerRequestInterface' => __DIR__ . '/..' . '/psr/http-message/src/ServerRequestInterface.php',
188
- '_PhpScoper5b6804f9734c8\\Psr\\Http\\Message\\StreamInterface' => __DIR__ . '/..' . '/psr/http-message/src/StreamInterface.php',
189
- '_PhpScoper5b6804f9734c8\\Psr\\Http\\Message\\UploadedFileInterface' => __DIR__ . '/..' . '/psr/http-message/src/UploadedFileInterface.php',
190
- '_PhpScoper5b6804f9734c8\\Psr\\Http\\Message\\UriInterface' => __DIR__ . '/..' . '/psr/http-message/src/UriInterface.php',
191
- '_PhpScoper5b6804f9734c8\\Tests\\Mollie\\Api\\CompatibilityCheckerTest' => __DIR__ . '/../..' . '/tests/Mollie/API/CompatibilityCheckerTest.php',
192
- '_PhpScoper5b6804f9734c8\\Tests\\Mollie\\Api\\Endpoints\\BaseEndpointTest' => __DIR__ . '/../..' . '/tests/Mollie/API/Endpoints/BaseEndpointTest.php',
193
- '_PhpScoper5b6804f9734c8\\Tests\\Mollie\\Api\\Endpoints\\ChargebackEndpointTest' => __DIR__ . '/../..' . '/tests/Mollie/API/Endpoints/ChargebackEndpointTest.php',
194
- '_PhpScoper5b6804f9734c8\\Tests\\Mollie\\Api\\Endpoints\\CustomerEndpointTest' => __DIR__ . '/../..' . '/tests/Mollie/API/Endpoints/CustomerEndpointTest.php',
195
- '_PhpScoper5b6804f9734c8\\Tests\\Mollie\\Api\\Endpoints\\CustomerPaymentEndpointTest' => __DIR__ . '/../..' . '/tests/Mollie/API/Endpoints/CustomerPaymentEndpointTest.php',
196
- '_PhpScoper5b6804f9734c8\\Tests\\Mollie\\Api\\Endpoints\\InvoiceEndpointTest' => __DIR__ . '/../..' . '/tests/Mollie/API/Endpoints/InvoiceEndpointTest.php',
197
- '_PhpScoper5b6804f9734c8\\Tests\\Mollie\\Api\\Endpoints\\MandateEndpointTest' => __DIR__ . '/../..' . '/tests/Mollie/API/Endpoints/MandateEndpointTest.php',
198
- '_PhpScoper5b6804f9734c8\\Tests\\Mollie\\Api\\Endpoints\\MethodEndpointTest' => __DIR__ . '/../..' . '/tests/Mollie/API/Endpoints/MethodEndpointTest.php',
199
- '_PhpScoper5b6804f9734c8\\Tests\\Mollie\\Api\\Endpoints\\PaymentEndpointTest' => __DIR__ . '/../..' . '/tests/Mollie/API/Endpoints/PaymentEndpointTest.php',
200
- '_PhpScoper5b6804f9734c8\\Tests\\Mollie\\Api\\Endpoints\\PaymentRefundEndpointTest' => __DIR__ . '/../..' . '/tests/Mollie/API/Endpoints/PaymentRefundEndpointTest.php',
201
- '_PhpScoper5b6804f9734c8\\Tests\\Mollie\\Api\\Endpoints\\ProfileEndpointTest' => __DIR__ . '/../..' . '/tests/Mollie/API/Endpoints/ProfileEndpointTest.php',
202
- '_PhpScoper5b6804f9734c8\\Tests\\Mollie\\Api\\Endpoints\\RefundEndpointTest' => __DIR__ . '/../..' . '/tests/Mollie/API/Endpoints/RefundEndpointTest.php',
203
- '_PhpScoper5b6804f9734c8\\Tests\\Mollie\\Api\\Endpoints\\SettlementEndpointTest' => __DIR__ . '/../..' . '/tests/Mollie/API/Endpoints/SettlementEndpointTest.php',
204
- '_PhpScoper5b6804f9734c8\\Tests\\Mollie\\Api\\Endpoints\\SubscriptionEndpointTest' => __DIR__ . '/../..' . '/tests/Mollie/API/Endpoints/SubscriptionEndpointTest.php',
205
- '_PhpScoper5b6804f9734c8\\Tests\\Mollie\\Api\\MollieApiClientTest' => __DIR__ . '/../..' . '/tests/Mollie/API/MollieApiClientTest.php',
206
- '_PhpScoper5b6804f9734c8\\Tests\\Mollie\\Api\\Resources\\InvoiceTest' => __DIR__ . '/../..' . '/tests/Mollie/API/Resources/InvoiceTest.php',
207
- '_PhpScoper5b6804f9734c8\\Tests\\Mollie\\Api\\Resources\\PaymentTest' => __DIR__ . '/../..' . '/tests/Mollie/API/Resources/PaymentTest.php',
208
- '_PhpScoper5b6804f9734c8\\Tests\\Mollie\\Api\\Resources\\ProfileTest' => __DIR__ . '/../..' . '/tests/Mollie/API/Resources/ProfileTest.php',
209
- '_PhpScoper5b6804f9734c8\\Tests\\Mollie\\Api\\Resources\\RefundTest' => __DIR__ . '/../..' . '/tests/Mollie/API/Resources/RefundTest.php',
210
- '_PhpScoper5b6804f9734c8\\Tests\\Mollie\\Api\\Resources\\ResourceFactoryTest' => __DIR__ . '/../..' . '/tests/Mollie/API/Resources/ResourceFactoryTest.php',
211
- '_PhpScoper5b6804f9734c8\\Tests\\Mollie\\Api\\Resources\\SettlementTest' => __DIR__ . '/../..' . '/tests/Mollie/API/Resources/SettlementTest.php',
212
- '_PhpScoper5b6804f9734c8\\Tests\\Mollie\\Api\\Resources\\SubscriptionTest' => __DIR__ . '/../..' . '/tests/Mollie/API/Resources/SubscriptionTest.php',
213
  );
214
 
215
  public static function getInitializer(ClassLoader $loader)
216
  {
217
  return \Closure::bind(function () use ($loader) {
218
- $loader->prefixLengthsPsr4 = ComposerStaticInit4062f91c07f6f2ba911ecd0f0813a468::$prefixLengthsPsr4;
219
- $loader->prefixDirsPsr4 = ComposerStaticInit4062f91c07f6f2ba911ecd0f0813a468::$prefixDirsPsr4;
220
- $loader->classMap = ComposerStaticInit4062f91c07f6f2ba911ecd0f0813a468::$classMap;
221
 
222
  }, null, ClassLoader::class);
223
  }
4
 
5
  namespace Composer\Autoload;
6
 
7
+ class ComposerStaticInitf1d08e70f69871d38ce5b109d41f0cad
8
  {
9
  public static $files = array (
10
  'c964ee0ededf28c96ebd9db5099ef910' => __DIR__ . '/..' . '/guzzlehttp/promises/src/functions_include.php',
13
  );
14
 
15
  public static $prefixLengthsPsr4 = array (
16
+ 'P' =>
17
  array (
18
+ 'Psr\\Http\\Message\\' => 17,
 
 
 
 
 
19
  ),
20
  'M' =>
21
  array (
22
  'Mollie\\Api\\' => 11,
23
  ),
24
+ 'G' =>
25
+ array (
26
+ 'GuzzleHttp\\Psr7\\' => 16,
27
+ 'GuzzleHttp\\Promise\\' => 19,
28
+ 'GuzzleHttp\\' => 11,
29
+ ),
30
+ 'C' =>
31
+ array (
32
+ 'Composer\\CaBundle\\' => 18,
33
+ ),
34
  );
35
 
36
  public static $prefixDirsPsr4 = array (
37
+ 'Psr\\Http\\Message\\' =>
38
  array (
39
+ 0 => __DIR__ . '/..' . '/psr/http-message/src',
40
  ),
41
+ 'Mollie\\Api\\' =>
42
  array (
43
+ 0 => __DIR__ . '/../..' . '/src',
44
  ),
45
+ 'GuzzleHttp\\Psr7\\' =>
46
  array (
47
  0 => __DIR__ . '/..' . '/guzzlehttp/psr7/src',
48
  ),
49
+ 'GuzzleHttp\\Promise\\' =>
50
  array (
51
  0 => __DIR__ . '/..' . '/guzzlehttp/promises/src',
52
  ),
53
+ 'GuzzleHttp\\' =>
54
  array (
55
  0 => __DIR__ . '/..' . '/guzzlehttp/guzzle/src',
56
  ),
57
+ 'Composer\\CaBundle\\' =>
58
  array (
59
  0 => __DIR__ . '/..' . '/composer/ca-bundle/src',
60
  ),
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
61
  );
62
 
63
  public static function getInitializer(ClassLoader $loader)
64
  {
65
  return \Closure::bind(function () use ($loader) {
66
+ $loader->prefixLengthsPsr4 = ComposerStaticInitf1d08e70f69871d38ce5b109d41f0cad::$prefixLengthsPsr4;
67
+ $loader->prefixDirsPsr4 = ComposerStaticInitf1d08e70f69871d38ce5b109d41f0cad::$prefixDirsPsr4;
 
68
 
69
  }, null, ClassLoader::class);
70
  }
includes/mollie-api-php/vendor/composer/ca-bundle/composer.json CHANGED
@@ -1,5 +1,5 @@
1
  {
2
- "name": "composer\/ca-bundle",
3
  "description": "Lets you find a path to the system CA bundle, and includes a fallback to the Mozilla CA bundle.",
4
  "type": "library",
5
  "license": "MIT",
@@ -14,12 +14,12 @@
14
  {
15
  "name": "Jordi Boggiano",
16
  "email": "j.boggiano@seld.be",
17
- "homepage": "http:\/\/seld.be"
18
  }
19
  ],
20
  "support": {
21
- "irc": "irc:\/\/irc.freenode.org\/composer",
22
- "issues": "https:\/\/github.com\/composer\/ca-bundle\/issues"
23
  },
24
  "require": {
25
  "ext-openssl": "*",
@@ -27,18 +27,18 @@
27
  "php": "^5.3.2 || ^7.0"
28
  },
29
  "require-dev": {
30
- "phpunit\/phpunit": "^4.8.35 || ^5.7 || ^6.5",
31
- "psr\/log": "^1.0",
32
- "symfony\/process": "^2.5 || ^3.0 || ^4.0"
33
  },
34
  "autoload": {
35
  "psr-4": {
36
- "_PhpScoper5b6804f9734c8\\Composer\\CaBundle\\": "src"
37
  }
38
  },
39
  "autoload-dev": {
40
  "psr-4": {
41
- "_PhpScoper5b6804f9734c8\\Composer\\CaBundle\\": "tests"
42
  }
43
  },
44
  "extra": {
@@ -51,4 +51,4 @@
51
  "php": "5.3.9"
52
  }
53
  }
54
- }
1
  {
2
+ "name": "composer/ca-bundle",
3
  "description": "Lets you find a path to the system CA bundle, and includes a fallback to the Mozilla CA bundle.",
4
  "type": "library",
5
  "license": "MIT",
14
  {
15
  "name": "Jordi Boggiano",
16
  "email": "j.boggiano@seld.be",
17
+ "homepage": "http://seld.be"
18
  }
19
  ],
20
  "support": {
21
+ "irc": "irc://irc.freenode.org/composer",
22
+ "issues": "https://github.com/composer/ca-bundle/issues"
23
  },
24
  "require": {
25
  "ext-openssl": "*",
27
  "php": "^5.3.2 || ^7.0"
28
  },
29
  "require-dev": {
30
+ "phpunit/phpunit": "^4.8.35 || ^5.7 || ^6.5",
31
+ "psr/log": "^1.0",
32
+ "symfony/process": "^2.5 || ^3.0 || ^4.0"
33
  },
34
  "autoload": {
35
  "psr-4": {
36
+ "Composer\\CaBundle\\": "src"
37
  }
38
  },
39
  "autoload-dev": {
40
  "psr-4": {
41
+ "Composer\\CaBundle\\": "tests"
42
  }
43
  },
44
  "extra": {
51
  "php": "5.3.9"
52
  }
53
  }
54
+ }
includes/mollie-api-php/vendor/composer/ca-bundle/src/CaBundle.php CHANGED
@@ -8,10 +8,12 @@
8
  * For the full copyright and license information, please view
9
  * the LICENSE file that was distributed with this source code.
10
  */
11
- namespace _PhpScoper5b6804f9734c8\Composer\CaBundle;
12
 
13
- use _PhpScoper5b6804f9734c8\Psr\Log\LoggerInterface;
14
- use _PhpScoper5b6804f9734c8\Symfony\Component\Process\PhpProcess;
 
 
 
15
  /**
16
  * @author Chris Smith <chris@cs278.org>
17
  * @author Jordi Boggiano <j.boggiano@seld.be>
@@ -21,6 +23,7 @@ class CaBundle
21
  private static $caPath;
22
  private static $caFileValidity = array();
23
  private static $useOpensslParse;
 
24
  /**
25
  * Returns the system CA bundle path, or a path to the bundled one
26
  *
@@ -58,68 +61,66 @@ class CaBundle
58
  * @param LoggerInterface $logger optional logger for information about which CA files were loaded
59
  * @return string path to a CA bundle file or directory
60
  */
61
- public static function getSystemCaRootBundlePath(\_PhpScoper5b6804f9734c8\Psr\Log\LoggerInterface $logger = null)
62
  {
63
  if (self::$caPath !== null) {
64
  return self::$caPath;
65
  }
 
66
  // If SSL_CERT_FILE env variable points to a valid certificate/bundle, use that.
67
  // This mimics how OpenSSL uses the SSL_CERT_FILE env variable.
68
- $envCertFile = \getenv('SSL_CERT_FILE');
69
- if ($envCertFile && \is_readable($envCertFile) && static::validateCaFile($envCertFile, $logger)) {
70
  return self::$caPath = $envCertFile;
71
  }
 
72
  // If SSL_CERT_DIR env variable points to a valid certificate/bundle, use that.
73
  // This mimics how OpenSSL uses the SSL_CERT_FILE env variable.
74
- $envCertDir = \getenv('SSL_CERT_DIR');
75
- if ($envCertDir && \is_dir($envCertDir) && \is_readable($envCertDir)) {
76
  return self::$caPath = $envCertDir;
77
  }
78
- $configured = \ini_get('openssl.cafile');
79
- if ($configured && \strlen($configured) > 0 && \is_readable($configured) && static::validateCaFile($configured, $logger)) {
 
80
  return self::$caPath = $configured;
81
  }
82
- $configured = \ini_get('openssl.capath');
83
- if ($configured && \is_dir($configured) && \is_readable($configured)) {
 
84
  return self::$caPath = $configured;
85
  }
 
86
  $caBundlePaths = array(
87
- '/etc/pki/tls/certs/ca-bundle.crt',
88
- // Fedora, RHEL, CentOS (ca-certificates package)
89
- '/etc/ssl/certs/ca-certificates.crt',
90
- // Debian, Ubuntu, Gentoo, Arch Linux (ca-certificates package)
91
- '/etc/ssl/ca-bundle.pem',
92
- // SUSE, openSUSE (ca-certificates package)
93
- '/usr/local/share/certs/ca-root-nss.crt',
94
- // FreeBSD (ca_root_nss_package)
95
- '/usr/ssl/certs/ca-bundle.crt',
96
- // Cygwin
97
- '/opt/local/share/curl/curl-ca-bundle.crt',
98
- // OS X macports, curl-ca-bundle package
99
- '/usr/local/share/curl/curl-ca-bundle.crt',
100
- // Default cURL CA bunde path (without --with-ca-bundle option)
101
- '/usr/share/ssl/certs/ca-bundle.crt',
102
- // Really old RedHat?
103
- '/etc/ssl/cert.pem',
104
- // OpenBSD
105
- '/usr/local/etc/ssl/cert.pem',
106
- // FreeBSD 10.x
107
- '/usr/local/etc/openssl/cert.pem',
108
  );
 
109
  foreach ($caBundlePaths as $caBundle) {
110
- if (@\is_readable($caBundle) && static::validateCaFile($caBundle, $logger)) {
111
  return self::$caPath = $caBundle;
112
  }
113
  }
 
114
  foreach ($caBundlePaths as $caBundle) {
115
- $caBundle = \dirname($caBundle);
116
- if (@\is_dir($caBundle) && \glob($caBundle . '/*')) {
117
  return self::$caPath = $caBundle;
118
  }
119
  }
120
- return self::$caPath = static::getBundledCaBundlePath();
121
- // Bundled CA file, last resort
122
  }
 
123
  /**
124
  * Returns the path to the bundled CA file
125
  *
@@ -129,18 +130,26 @@ class CaBundle
129
  */
130
  public static function getBundledCaBundlePath()
131
  {
132
- $caBundleFile = __DIR__ . '/../res/cacert.pem';
 
133
  // cURL does not understand 'phar://' paths
134
  // see https://github.com/composer/ca-bundle/issues/10
135
- if (0 === \strpos($caBundleFile, 'phar://')) {
136
- \file_put_contents($tempCaBundleFile = \tempnam(\sys_get_temp_dir(), 'openssl-ca-bundle-'), \file_get_contents($caBundleFile));
137
- \register_shutdown_function(function () use($tempCaBundleFile) {
138
- @\unlink($tempCaBundleFile);
 
 
 
 
139
  });
 
140
  $caBundleFile = $tempCaBundleFile;
141
  }
 
142
  return $caBundleFile;
143
  }
 
144
  /**
145
  * Validates a CA file using opensl_x509_parse only if it is safe to use
146
  *
@@ -149,29 +158,39 @@ class CaBundle
149
  *
150
  * @return bool
151
  */
152
- public static function validateCaFile($filename, \_PhpScoper5b6804f9734c8\Psr\Log\LoggerInterface $logger = null)
153
  {
154
- static $warned = \false;
 
155
  if (isset(self::$caFileValidity[$filename])) {
156
  return self::$caFileValidity[$filename];
157
  }
158
- $contents = \file_get_contents($filename);
 
 
159
  // assume the CA is valid if php is vulnerable to
160
  // https://www.sektioneins.de/advisories/advisory-012013-php-openssl_x509_parse-memory-corruption-vulnerability.html
161
  if (!static::isOpensslParseSafe()) {
162
  if (!$warned && $logger) {
163
- $logger->warning(\sprintf('Your version of PHP, %s, is affected by CVE-2013-6420 and cannot safely perform certificate validation, we strongly suggest you upgrade.', \PHP_VERSION));
164
- $warned = \true;
 
 
 
165
  }
 
166
  $isValid = !empty($contents);
167
  } else {
168
- $isValid = (bool) \openssl_x509_parse($contents);
169
  }
 
170
  if ($logger) {
171
- $logger->debug('Checked CA file ' . \realpath($filename) . ': ' . ($isValid ? 'valid' : 'invalid'));
172
  }
 
173
  return self::$caFileValidity[$filename] = $isValid;
174
  }
 
175
  /**
176
  * Test if it is safe to use the PHP function openssl_x509_parse().
177
  *
@@ -185,42 +204,60 @@ class CaBundle
185
  if (null !== self::$useOpensslParse) {
186
  return self::$useOpensslParse;
187
  }
188
- if (\PHP_VERSION_ID >= 50600) {
189
- return self::$useOpensslParse = \true;
 
190
  }
 
191
  // Vulnerable:
192
  // PHP 5.3.0 - PHP 5.3.27
193
  // PHP 5.4.0 - PHP 5.4.22
194
  // PHP 5.5.0 - PHP 5.5.6
195
- if (\PHP_VERSION_ID < 50400 && \PHP_VERSION_ID >= 50328 || \PHP_VERSION_ID < 50500 && \PHP_VERSION_ID >= 50423 || \PHP_VERSION_ID < 50600 && \PHP_VERSION_ID >= 50507) {
 
 
 
 
196
  // This version of PHP has the fix for CVE-2013-6420 applied.
197
- return self::$useOpensslParse = \true;
198
  }
199
- if (\defined('PHP_WINDOWS_VERSION_BUILD')) {
 
200
  // Windows is probably insecure in this case.
201
- return self::$useOpensslParse = \false;
202
  }
 
203
  $compareDistroVersionPrefix = function ($prefix, $fixedVersion) {
204
- $regex = '{^' . \preg_quote($prefix) . '([0-9]+)$}';
205
- if (\preg_match($regex, \PHP_VERSION, $m)) {
206
- return (int) $m[1] >= $fixedVersion;
 
207
  }
208
- return \false;
 
209
  };
 
210
  // Hard coded list of PHP distributions with the fix backported.
211
- if ($compareDistroVersionPrefix('5.3.3-7+squeeze', 18) || $compareDistroVersionPrefix('5.4.4-14+deb7u', 7) || $compareDistroVersionPrefix('5.3.10-1ubuntu3.', 9)) {
212
- return self::$useOpensslParse = \true;
 
 
 
 
213
  }
 
214
  // Symfony Process component is missing so we assume it is unsafe at this point
215
- if (!\class_exists('_PhpScoper5b6804f9734c8\\Symfony\\Component\\Process\\PhpProcess')) {
216
- return self::$useOpensslParse = \false;
217
  }
 
218
  // This is where things get crazy, because distros backport security
219
  // fixes the chances are on NIX systems the fix has been applied but
220
  // it's not possible to verify that from the PHP version.
221
  //
222
  // To verify exec a new PHP process and run the issue testcase with
223
  // known safe input that replicates the bug.
 
224
  // Based on testcase in https://github.com/php/php-src/commit/c1224573c773b6845e83505f717fbf820fc18415
225
  // changes in https://github.com/php/php-src/commit/76a7fd893b7d6101300cc656058704a73254d593
226
  $cert = 'LS0tLS1CRUdJTiBDRVJUSUZJQ0FURS0tLS0tCk1JSUVwRENDQTR5Z0F3SUJBZ0lKQUp6dThyNnU2ZUJjTUEwR0NTcUdTSWIzRFFFQkJRVUFNSUhETVFzd0NRWUQKVlFRR0V3SkVSVEVjTUJvR0ExVUVDQXdUVG05eVpISm9aV2x1TFZkbGMzUm1ZV3hsYmpFUU1BNEdBMVVFQnd3SApTOE9Ed3Jac2JqRVVNQklHQTFVRUNnd0xVMlZyZEdsdmJrVnBibk14SHpBZEJnTlZCQXNNRmsxaGJHbGphVzkxCmN5QkRaWEowSUZObFkzUnBiMjR4SVRBZkJnTlZCQU1NR0cxaGJHbGphVzkxY3k1elpXdDBhVzl1WldsdWN5NWsKWlRFcU1DZ0dDU3FHU0liM0RRRUpBUlliYzNSbFptRnVMbVZ6YzJWeVFITmxhM1JwYjI1bGFXNXpMbVJsTUhVWQpaREU1TnpBd01UQXhNREF3TURBd1dnQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBCkFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUEKQUFBQUFBQVhEVEUwTVRFeU9ERXhNemt6TlZvd2djTXhDekFKQmdOVkJBWVRBa1JGTVJ3d0dnWURWUVFJREJOTwpiM0prY21obGFXNHRWMlZ6ZEdaaGJHVnVNUkF3RGdZRFZRUUhEQWRMdzRQQ3RteHVNUlF3RWdZRFZRUUtEQXRUClpXdDBhVzl1UldsdWN6RWZNQjBHQTFVRUN3d1dUV0ZzYVdOcGIzVnpJRU5sY25RZ1UyVmpkR2x2YmpFaE1COEcKQTFVRUF3d1liV0ZzYVdOcGIzVnpMbk5sYTNScGIyNWxhVzV6TG1SbE1Tb3dLQVlKS29aSWh2Y05BUWtCRmh0egpkR1ZtWVc0dVpYTnpaWEpBYzJWcmRHbHZibVZwYm5NdVpHVXdnZ0VpTUEwR0NTcUdTSWIzRFFFQkFRVUFBNElCCkR3QXdnZ0VLQW9JQkFRRERBZjNobDdKWTBYY0ZuaXlFSnBTU0RxbjBPcUJyNlFQNjV1c0pQUnQvOFBhRG9xQnUKd0VZVC9OYSs2ZnNnUGpDMHVLOURaZ1dnMnRIV1dvYW5TYmxBTW96NVBINlorUzRTSFJaN2UyZERJalBqZGhqaAowbUxnMlVNTzV5cDBWNzk3R2dzOWxOdDZKUmZIODFNTjJvYlhXczROdHp0TE11RDZlZ3FwcjhkRGJyMzRhT3M4CnBrZHVpNVVhd1Raa3N5NXBMUEhxNWNNaEZHbTA2djY1Q0xvMFYyUGQ5K0tBb2tQclBjTjVLTEtlYno3bUxwazYKU01lRVhPS1A0aWRFcXh5UTdPN2ZCdUhNZWRzUWh1K3ByWTNzaTNCVXlLZlF0UDVDWm5YMmJwMHdLSHhYMTJEWAoxbmZGSXQ5RGJHdkhUY3lPdU4rblpMUEJtM3ZXeG50eUlJdlZBZ01CQUFHalFqQkFNQWtHQTFVZEV3UUNNQUF3CkVRWUpZSVpJQVliNFFnRUJCQVFEQWdlQU1Bc0dBMVVkRHdRRUF3SUZvREFUQmdOVkhTVUVEREFLQmdnckJnRUYKQlFjREFqQU5CZ2txaGtpRzl3MEJBUVVGQUFPQ0FRRUFHMGZaWVlDVGJkajFYWWMrMVNub2FQUit2SThDOENhRAo4KzBVWWhkbnlVNGdnYTBCQWNEclk5ZTk0ZUVBdTZacXljRjZGakxxWFhkQWJvcHBXb2NyNlQ2R0QxeDMzQ2tsClZBcnpHL0t4UW9oR0QySmVxa2hJTWxEb214SE83a2EzOStPYThpMnZXTFZ5alU4QVp2V01BcnVIYTRFRU55RzcKbFcyQWFnYUZLRkNyOVRuWFRmcmR4R1ZFYnY3S1ZRNmJkaGc1cDVTanBXSDErTXEwM3VSM1pYUEJZZHlWODMxOQpvMGxWajFLRkkyRENML2xpV2lzSlJvb2YrMWNSMzVDdGQwd1lCY3BCNlRac2xNY09QbDc2ZHdLd0pnZUpvMlFnClpzZm1jMnZDMS9xT2xOdU5xLzBUenprVkd2OEVUVDNDZ2FVK1VYZTRYT1Z2a2NjZWJKbjJkZz09Ci0tLS0tRU5EIENFUlRJRklDQVRFLS0tLS0K';
@@ -231,23 +268,34 @@ $info = openssl_x509_parse(base64_decode('%s'));
231
  var_dump(PHP_VERSION, $info['issuer']['emailAddress'], $info['validFrom_time_t']);
232
 
233
  EOT;
234
- $script = '<' . "?php\n" . \sprintf($script, $cert);
 
235
  try {
236
- $process = new \_PhpScoper5b6804f9734c8\Symfony\Component\Process\PhpProcess($script);
237
  $process->mustRun();
238
  } catch (\Exception $e) {
239
  // In the case of any exceptions just accept it is not possible to
240
  // determine the safety of openssl_x509_parse and bail out.
241
- return self::$useOpensslParse = \false;
242
  }
243
- $output = \preg_split('{\\r?\\n}', \trim($process->getOutput()));
244
- $errorOutput = \trim($process->getErrorOutput());
245
- if (\count($output) === 3 && $output[0] === \sprintf('string(%d) "%s"', \strlen(\PHP_VERSION), \PHP_VERSION) && $output[1] === 'string(27) "stefan.esser@sektioneins.de"' && $output[2] === 'int(-1)' && \preg_match('{openssl_x509_parse\\(\\): illegal (?:ASN1 data type for|length in) timestamp in - on line \\d+}', $errorOutput)) {
 
 
 
 
 
 
 
 
246
  // This PHP has the fix backported probably by a distro security team.
247
- return self::$useOpensslParse = \true;
248
  }
249
- return self::$useOpensslParse = \false;
 
250
  }
 
251
  /**
252
  * Resets the static caches
253
  */
8
  * For the full copyright and license information, please view
9
  * the LICENSE file that was distributed with this source code.
10
  */
 
11
 
12
+ namespace Composer\CaBundle;
13
+
14
+ use Psr\Log\LoggerInterface;
15
+ use Symfony\Component\Process\PhpProcess;
16
+
17
  /**
18
  * @author Chris Smith <chris@cs278.org>
19
  * @author Jordi Boggiano <j.boggiano@seld.be>
23
  private static $caPath;
24
  private static $caFileValidity = array();
25
  private static $useOpensslParse;
26
+
27
  /**
28
  * Returns the system CA bundle path, or a path to the bundled one
29
  *
61
  * @param LoggerInterface $logger optional logger for information about which CA files were loaded
62
  * @return string path to a CA bundle file or directory
63
  */
64
+ public static function getSystemCaRootBundlePath(LoggerInterface $logger = null)
65
  {
66
  if (self::$caPath !== null) {
67
  return self::$caPath;
68
  }
69
+
70
  // If SSL_CERT_FILE env variable points to a valid certificate/bundle, use that.
71
  // This mimics how OpenSSL uses the SSL_CERT_FILE env variable.
72
+ $envCertFile = getenv('SSL_CERT_FILE');
73
+ if ($envCertFile && is_readable($envCertFile) && static::validateCaFile($envCertFile, $logger)) {
74
  return self::$caPath = $envCertFile;
75
  }
76
+
77
  // If SSL_CERT_DIR env variable points to a valid certificate/bundle, use that.
78
  // This mimics how OpenSSL uses the SSL_CERT_FILE env variable.
79
+ $envCertDir = getenv('SSL_CERT_DIR');
80
+ if ($envCertDir && is_dir($envCertDir) && is_readable($envCertDir)) {
81
  return self::$caPath = $envCertDir;
82
  }
83
+
84
+ $configured = ini_get('openssl.cafile');
85
+ if ($configured && strlen($configured) > 0 && is_readable($configured) && static::validateCaFile($configured, $logger)) {
86
  return self::$caPath = $configured;
87
  }
88
+
89
+ $configured = ini_get('openssl.capath');
90
+ if ($configured && is_dir($configured) && is_readable($configured)) {
91
  return self::$caPath = $configured;
92
  }
93
+
94
  $caBundlePaths = array(
95
+ '/etc/pki/tls/certs/ca-bundle.crt', // Fedora, RHEL, CentOS (ca-certificates package)
96
+ '/etc/ssl/certs/ca-certificates.crt', // Debian, Ubuntu, Gentoo, Arch Linux (ca-certificates package)
97
+ '/etc/ssl/ca-bundle.pem', // SUSE, openSUSE (ca-certificates package)
98
+ '/usr/local/share/certs/ca-root-nss.crt', // FreeBSD (ca_root_nss_package)
99
+ '/usr/ssl/certs/ca-bundle.crt', // Cygwin
100
+ '/opt/local/share/curl/curl-ca-bundle.crt', // OS X macports, curl-ca-bundle package
101
+ '/usr/local/share/curl/curl-ca-bundle.crt', // Default cURL CA bunde path (without --with-ca-bundle option)
102
+ '/usr/share/ssl/certs/ca-bundle.crt', // Really old RedHat?
103
+ '/etc/ssl/cert.pem', // OpenBSD
104
+ '/usr/local/etc/ssl/cert.pem', // FreeBSD 10.x
105
+ '/usr/local/etc/openssl/cert.pem', // OS X homebrew, openssl package
 
 
 
 
 
 
 
 
 
 
106
  );
107
+
108
  foreach ($caBundlePaths as $caBundle) {
109
+ if (@is_readable($caBundle) && static::validateCaFile($caBundle, $logger)) {
110
  return self::$caPath = $caBundle;
111
  }
112
  }
113
+
114
  foreach ($caBundlePaths as $caBundle) {
115
+ $caBundle = dirname($caBundle);
116
+ if (@is_dir($caBundle) && glob($caBundle.'/*')) {
117
  return self::$caPath = $caBundle;
118
  }
119
  }
120
+
121
+ return self::$caPath = static::getBundledCaBundlePath(); // Bundled CA file, last resort
122
  }
123
+
124
  /**
125
  * Returns the path to the bundled CA file
126
  *
130
  */
131
  public static function getBundledCaBundlePath()
132
  {
133
+ $caBundleFile = __DIR__.'/../res/cacert.pem';
134
+
135
  // cURL does not understand 'phar://' paths
136
  // see https://github.com/composer/ca-bundle/issues/10
137
+ if (0 === strpos($caBundleFile, 'phar://')) {
138
+ file_put_contents(
139
+ $tempCaBundleFile = tempnam(sys_get_temp_dir(), 'openssl-ca-bundle-'),
140
+ file_get_contents($caBundleFile)
141
+ );
142
+
143
+ register_shutdown_function(function() use ($tempCaBundleFile) {
144
+ @unlink($tempCaBundleFile);
145
  });
146
+
147
  $caBundleFile = $tempCaBundleFile;
148
  }
149
+
150
  return $caBundleFile;
151
  }
152
+
153
  /**
154
  * Validates a CA file using opensl_x509_parse only if it is safe to use
155
  *
158
  *
159
  * @return bool
160
  */
161
+ public static function validateCaFile($filename, LoggerInterface $logger = null)
162
  {
163
+ static $warned = false;
164
+
165
  if (isset(self::$caFileValidity[$filename])) {
166
  return self::$caFileValidity[$filename];
167
  }
168
+
169
+ $contents = file_get_contents($filename);
170
+
171
  // assume the CA is valid if php is vulnerable to
172
  // https://www.sektioneins.de/advisories/advisory-012013-php-openssl_x509_parse-memory-corruption-vulnerability.html
173
  if (!static::isOpensslParseSafe()) {
174
  if (!$warned && $logger) {
175
+ $logger->warning(sprintf(
176
+ 'Your version of PHP, %s, is affected by CVE-2013-6420 and cannot safely perform certificate validation, we strongly suggest you upgrade.',
177
+ PHP_VERSION
178
+ ));
179
+ $warned = true;
180
  }
181
+
182
  $isValid = !empty($contents);
183
  } else {
184
+ $isValid = (bool) openssl_x509_parse($contents);
185
  }
186
+
187
  if ($logger) {
188
+ $logger->debug('Checked CA file '.realpath($filename).': '.($isValid ? 'valid' : 'invalid'));
189
  }
190
+
191
  return self::$caFileValidity[$filename] = $isValid;
192
  }
193
+
194
  /**
195
  * Test if it is safe to use the PHP function openssl_x509_parse().
196
  *
204
  if (null !== self::$useOpensslParse) {
205
  return self::$useOpensslParse;
206
  }
207
+
208
+ if (PHP_VERSION_ID >= 50600) {
209
+ return self::$useOpensslParse = true;
210
  }
211
+
212
  // Vulnerable:
213
  // PHP 5.3.0 - PHP 5.3.27
214
  // PHP 5.4.0 - PHP 5.4.22
215
  // PHP 5.5.0 - PHP 5.5.6
216
+ if (
217
+ (PHP_VERSION_ID < 50400 && PHP_VERSION_ID >= 50328)
218
+ || (PHP_VERSION_ID < 50500 && PHP_VERSION_ID >= 50423)
219
+ || (PHP_VERSION_ID < 50600 && PHP_VERSION_ID >= 50507)
220
+ ) {
221
  // This version of PHP has the fix for CVE-2013-6420 applied.
222
+ return self::$useOpensslParse = true;
223
  }
224
+
225
+ if (defined('PHP_WINDOWS_VERSION_BUILD')) {
226
  // Windows is probably insecure in this case.
227
+ return self::$useOpensslParse = false;
228
  }
229
+
230
  $compareDistroVersionPrefix = function ($prefix, $fixedVersion) {
231
+ $regex = '{^'.preg_quote($prefix).'([0-9]+)$}';
232
+
233
+ if (preg_match($regex, PHP_VERSION, $m)) {
234
+ return ((int) $m[1]) >= $fixedVersion;
235
  }
236
+
237
+ return false;
238
  };
239
+
240
  // Hard coded list of PHP distributions with the fix backported.
241
+ if (
242
+ $compareDistroVersionPrefix('5.3.3-7+squeeze', 18) // Debian 6 (Squeeze)
243
+ || $compareDistroVersionPrefix('5.4.4-14+deb7u', 7) // Debian 7 (Wheezy)
244
+ || $compareDistroVersionPrefix('5.3.10-1ubuntu3.', 9) // Ubuntu 12.04 (Precise)
245
+ ) {
246
+ return self::$useOpensslParse = true;
247
  }
248
+
249
  // Symfony Process component is missing so we assume it is unsafe at this point
250
+ if (!class_exists('Symfony\Component\Process\PhpProcess')) {
251
+ return self::$useOpensslParse = false;
252
  }
253
+
254
  // This is where things get crazy, because distros backport security
255
  // fixes the chances are on NIX systems the fix has been applied but
256
  // it's not possible to verify that from the PHP version.
257
  //
258
  // To verify exec a new PHP process and run the issue testcase with
259
  // known safe input that replicates the bug.
260
+
261
  // Based on testcase in https://github.com/php/php-src/commit/c1224573c773b6845e83505f717fbf820fc18415
262
  // changes in https://github.com/php/php-src/commit/76a7fd893b7d6101300cc656058704a73254d593
263
  $cert = 'LS0tLS1CRUdJTiBDRVJUSUZJQ0FURS0tLS0tCk1JSUVwRENDQTR5Z0F3SUJBZ0lKQUp6dThyNnU2ZUJjTUEwR0NTcUdTSWIzRFFFQkJRVUFNSUhETVFzd0NRWUQKVlFRR0V3SkVSVEVjTUJvR0ExVUVDQXdUVG05eVpISm9aV2x1TFZkbGMzUm1ZV3hsYmpFUU1BNEdBMVVFQnd3SApTOE9Ed3Jac2JqRVVNQklHQTFVRUNnd0xVMlZyZEdsdmJrVnBibk14SHpBZEJnTlZCQXNNRmsxaGJHbGphVzkxCmN5QkRaWEowSUZObFkzUnBiMjR4SVRBZkJnTlZCQU1NR0cxaGJHbGphVzkxY3k1elpXdDBhVzl1WldsdWN5NWsKWlRFcU1DZ0dDU3FHU0liM0RRRUpBUlliYzNSbFptRnVMbVZ6YzJWeVFITmxhM1JwYjI1bGFXNXpMbVJsTUhVWQpaREU1TnpBd01UQXhNREF3TURBd1dnQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBCkFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUEKQUFBQUFBQVhEVEUwTVRFeU9ERXhNemt6TlZvd2djTXhDekFKQmdOVkJBWVRBa1JGTVJ3d0dnWURWUVFJREJOTwpiM0prY21obGFXNHRWMlZ6ZEdaaGJHVnVNUkF3RGdZRFZRUUhEQWRMdzRQQ3RteHVNUlF3RWdZRFZRUUtEQXRUClpXdDBhVzl1UldsdWN6RWZNQjBHQTFVRUN3d1dUV0ZzYVdOcGIzVnpJRU5sY25RZ1UyVmpkR2x2YmpFaE1COEcKQTFVRUF3d1liV0ZzYVdOcGIzVnpMbk5sYTNScGIyNWxhVzV6TG1SbE1Tb3dLQVlKS29aSWh2Y05BUWtCRmh0egpkR1ZtWVc0dVpYTnpaWEpBYzJWcmRHbHZibVZwYm5NdVpHVXdnZ0VpTUEwR0NTcUdTSWIzRFFFQkFRVUFBNElCCkR3QXdnZ0VLQW9JQkFRRERBZjNobDdKWTBYY0ZuaXlFSnBTU0RxbjBPcUJyNlFQNjV1c0pQUnQvOFBhRG9xQnUKd0VZVC9OYSs2ZnNnUGpDMHVLOURaZ1dnMnRIV1dvYW5TYmxBTW96NVBINlorUzRTSFJaN2UyZERJalBqZGhqaAowbUxnMlVNTzV5cDBWNzk3R2dzOWxOdDZKUmZIODFNTjJvYlhXczROdHp0TE11RDZlZ3FwcjhkRGJyMzRhT3M4CnBrZHVpNVVhd1Raa3N5NXBMUEhxNWNNaEZHbTA2djY1Q0xvMFYyUGQ5K0tBb2tQclBjTjVLTEtlYno3bUxwazYKU01lRVhPS1A0aWRFcXh5UTdPN2ZCdUhNZWRzUWh1K3ByWTNzaTNCVXlLZlF0UDVDWm5YMmJwMHdLSHhYMTJEWAoxbmZGSXQ5RGJHdkhUY3lPdU4rblpMUEJtM3ZXeG50eUlJdlZBZ01CQUFHalFqQkFNQWtHQTFVZEV3UUNNQUF3CkVRWUpZSVpJQVliNFFnRUJCQVFEQWdlQU1Bc0dBMVVkRHdRRUF3SUZvREFUQmdOVkhTVUVEREFLQmdnckJnRUYKQlFjREFqQU5CZ2txaGtpRzl3MEJBUVVGQUFPQ0FRRUFHMGZaWVlDVGJkajFYWWMrMVNub2FQUit2SThDOENhRAo4KzBVWWhkbnlVNGdnYTBCQWNEclk5ZTk0ZUVBdTZacXljRjZGakxxWFhkQWJvcHBXb2NyNlQ2R0QxeDMzQ2tsClZBcnpHL0t4UW9oR0QySmVxa2hJTWxEb214SE83a2EzOStPYThpMnZXTFZ5alU4QVp2V01BcnVIYTRFRU55RzcKbFcyQWFnYUZLRkNyOVRuWFRmcmR4R1ZFYnY3S1ZRNmJkaGc1cDVTanBXSDErTXEwM3VSM1pYUEJZZHlWODMxOQpvMGxWajFLRkkyRENML2xpV2lzSlJvb2YrMWNSMzVDdGQwd1lCY3BCNlRac2xNY09QbDc2ZHdLd0pnZUpvMlFnClpzZm1jMnZDMS9xT2xOdU5xLzBUenprVkd2OEVUVDNDZ2FVK1VYZTRYT1Z2a2NjZWJKbjJkZz09Ci0tLS0tRU5EIENFUlRJRklDQVRFLS0tLS0K';
268
  var_dump(PHP_VERSION, $info['issuer']['emailAddress'], $info['validFrom_time_t']);
269
 
270
  EOT;
271
+ $script = '<'."?php\n".sprintf($script, $cert);
272
+
273
  try {
274
+ $process = new PhpProcess($script);
275
  $process->mustRun();
276
  } catch (\Exception $e) {
277
  // In the case of any exceptions just accept it is not possible to
278
  // determine the safety of openssl_x509_parse and bail out.
279
+ return self::$useOpensslParse = false;
280
  }
281
+
282
+ $output = preg_split('{\r?\n}', trim($process->getOutput()));
283
+ $errorOutput = trim($process->getErrorOutput());
284
+
285
+ if (
286
+ count($output) === 3
287
+ && $output[0] === sprintf('string(%d) "%s"', strlen(PHP_VERSION), PHP_VERSION)
288
+ && $output[1] === 'string(27) "stefan.esser@sektioneins.de"'
289
+ && $output[2] === 'int(-1)'
290
+ && preg_match('{openssl_x509_parse\(\): illegal (?:ASN1 data type for|length in) timestamp in - on line \d+}', $errorOutput)
291
+ ) {
292
  // This PHP has the fix backported probably by a distro security team.
293
+ return self::$useOpensslParse = true;
294
  }
295
+
296
+ return self::$useOpensslParse = false;
297
  }
298
+
299
  /**
300
  * Resets the static caches
301
  */
includes/mollie-api-php/vendor/composer/installed.json CHANGED
@@ -1,16 +1,16 @@
1
  [
2
  {
3
- "name": "composer\/ca-bundle",
4
  "version": "1.1.1",
5
  "version_normalized": "1.1.1.0",
6
  "source": {
7
  "type": "git",
8
- "url": "https:\/\/github.com\/composer\/ca-bundle.git",
9
  "reference": "d2c0a83b7533d6912e8d516756ebd34f893e9169"
10
  },
11
  "dist": {
12
  "type": "zip",
13
- "url": "https:\/\/api.github.com\/repos\/composer\/ca-bundle\/zipball\/d2c0a83b7533d6912e8d516756ebd34f893e9169",
14
  "reference": "d2c0a83b7533d6912e8d516756ebd34f893e9169",
15
  "shasum": ""
16
  },
@@ -20,9 +20,9 @@
20
  "php": "^5.3.2 || ^7.0"
21
  },
22
  "require-dev": {
23
- "phpunit\/phpunit": "^4.8.35 || ^5.7 || ^6.5",
24
- "psr\/log": "^1.0",
25
- "symfony\/process": "^2.5 || ^3.0 || ^4.0"
26
  },
27
  "time": "2018-03-29T19:57:20+00:00",
28
  "type": "library",
@@ -34,10 +34,10 @@
34
  "installation-source": "dist",
35
  "autoload": {
36
  "psr-4": {
37
- "_PhpScoper5b6804f9734c8\\Composer\\CaBundle\\": "src"
38
  }
39
  },
40
- "notification-url": "https:\/\/packagist.org\/downloads\/",
41
  "license": [
42
  "MIT"
43
  ],
@@ -45,7 +45,7 @@
45
  {
46
  "name": "Jordi Boggiano",
47
  "email": "j.boggiano@seld.be",
48
- "homepage": "http:\/\/seld.be"
49
  }
50
  ],
51
  "description": "Lets you find a path to the system CA bundle, and includes a fallback to the Mozilla CA bundle.",
@@ -58,32 +58,32 @@
58
  ]
59
  },
60
  {
61
- "name": "guzzlehttp\/guzzle",
62
  "version": "6.3.3",
63
  "version_normalized": "6.3.3.0",
64
  "source": {
65
  "type": "git",
66
- "url": "https:\/\/github.com\/guzzle\/guzzle.git",
67
  "reference": "407b0cb880ace85c9b63c5f9551db498cb2d50ba"
68
  },
69
  "dist": {
70
  "type": "zip",
71
- "url": "https:\/\/api.github.com\/repos\/guzzle\/guzzle\/zipball\/407b0cb880ace85c9b63c5f9551db498cb2d50ba",
72
  "reference": "407b0cb880ace85c9b63c5f9551db498cb2d50ba",
73
  "shasum": ""
74
  },
75
  "require": {
76
- "guzzlehttp\/promises": "^1.0",
77
- "guzzlehttp\/psr7": "^1.4",
78
  "php": ">=5.5"
79
  },
80
  "require-dev": {
81
  "ext-curl": "*",
82
- "phpunit\/phpunit": "^4.8.35 || ^5.7 || ^6.4 || ^7.0",
83
- "psr\/log": "^1.0"
84
  },
85
  "suggest": {
86
- "psr\/log": "Required for using the Log middleware"
87
  },
88
  "time": "2018-04-22T15:46:56+00:00",
89
  "type": "library",
@@ -95,13 +95,13 @@
95
  "installation-source": "dist",
96
  "autoload": {
97
  "files": [
98
- "src\/functions_include.php"
99
  ],
100
  "psr-4": {
101
- "_PhpScoper5b6804f9734c8\\GuzzleHttp\\": "src\/"
102
  }
103
  },
104
- "notification-url": "https:\/\/packagist.org\/downloads\/",
105
  "license": [
106
  "MIT"
107
  ],
@@ -109,11 +109,11 @@
109
  {
110
  "name": "Michael Dowling",
111
  "email": "mtdowling@gmail.com",
112
- "homepage": "https:\/\/github.com\/mtdowling"
113
  }
114
  ],
115
  "description": "Guzzle is a PHP HTTP client library",
116
- "homepage": "http:\/\/guzzlephp.org\/",
117
  "keywords": [
118
  "client",
119
  "curl",
@@ -125,17 +125,17 @@
125
  ]
126
  },
127
  {
128
- "name": "guzzlehttp\/promises",
129
  "version": "v1.3.1",
130
  "version_normalized": "1.3.1.0",
131
  "source": {
132
  "type": "git",
133
- "url": "https:\/\/github.com\/guzzle\/promises.git",
134
  "reference": "a59da6cf61d80060647ff4d3eb2c03a2bc694646"
135
  },
136
  "dist": {
137
  "type": "zip",
138
- "url": "https:\/\/api.github.com\/repos\/guzzle\/promises\/zipball\/a59da6cf61d80060647ff4d3eb2c03a2bc694646",
139
  "reference": "a59da6cf61d80060647ff4d3eb2c03a2bc694646",
140
  "shasum": ""
141
  },
@@ -143,7 +143,7 @@
143
  "php": ">=5.5.0"
144
  },
145
  "require-dev": {
146
- "phpunit\/phpunit": "^4.0"
147
  },
148
  "time": "2016-12-20T10:07:11+00:00",
149
  "type": "library",
@@ -155,13 +155,13 @@
155
  "installation-source": "dist",
156
  "autoload": {
157
  "psr-4": {
158
- "_PhpScoper5b6804f9734c8\\GuzzleHttp\\Promise\\": "src\/"
159
  },
160
  "files": [
161
- "src\/functions_include.php"
162
  ]
163
  },
164
- "notification-url": "https:\/\/packagist.org\/downloads\/",
165
  "license": [
166
  "MIT"
167
  ],
@@ -169,7 +169,7 @@
169
  {
170
  "name": "Michael Dowling",
171
  "email": "mtdowling@gmail.com",
172
- "homepage": "https:\/\/github.com\/mtdowling"
173
  }
174
  ],
175
  "description": "Guzzle promises library",
@@ -178,29 +178,29 @@
178
  ]
179
  },
180
  {
181
- "name": "guzzlehttp\/psr7",
182
  "version": "1.4.2",
183
  "version_normalized": "1.4.2.0",
184
  "source": {
185
  "type": "git",
186
- "url": "https:\/\/github.com\/guzzle\/psr7.git",
187
  "reference": "f5b8a8512e2b58b0071a7280e39f14f72e05d87c"
188
  },
189
  "dist": {
190
  "type": "zip",
191
- "url": "https:\/\/api.github.com\/repos\/guzzle\/psr7\/zipball\/f5b8a8512e2b58b0071a7280e39f14f72e05d87c",
192
  "reference": "f5b8a8512e2b58b0071a7280e39f14f72e05d87c",
193
  "shasum": ""
194
  },
195
  "require": {
196
  "php": ">=5.4.0",
197
- "psr\/http-message": "~1.0"
198
  },
199
  "provide": {
200
- "psr\/http-message-implementation": "1.0"
201
  },
202
  "require-dev": {
203
- "phpunit\/phpunit": "~4.0"
204
  },
205
  "time": "2017-03-20T17:10:46+00:00",
206
  "type": "library",
@@ -212,13 +212,13 @@
212
  "installation-source": "dist",
213
  "autoload": {
214
  "psr-4": {
215
- "_PhpScoper5b6804f9734c8\\GuzzleHttp\\Psr7\\": "src\/"
216
  },
217
  "files": [
218
- "src\/functions_include.php"
219
  ]
220
  },
221
- "notification-url": "https:\/\/packagist.org\/downloads\/",
222
  "license": [
223
  "MIT"
224
  ],
@@ -226,11 +226,11 @@
226
  {
227
  "name": "Michael Dowling",
228
  "email": "mtdowling@gmail.com",
229
- "homepage": "https:\/\/github.com\/mtdowling"
230
  },
231
  {
232
  "name": "Tobias Schultze",
233
- "homepage": "https:\/\/github.com\/Tobion"
234
  }
235
  ],
236
  "description": "PSR-7 message implementation that also provides common utility methods",
@@ -245,17 +245,17 @@
245
  ]
246
  },
247
  {
248
- "name": "psr\/http-message",
249
  "version": "1.0.1",
250
  "version_normalized": "1.0.1.0",
251
  "source": {
252
  "type": "git",
253
- "url": "https:\/\/github.com\/php-fig\/http-message.git",
254
  "reference": "f6561bf28d520154e4b0ec72be95418abe6d9363"
255
  },
256
  "dist": {
257
  "type": "zip",
258
- "url": "https:\/\/api.github.com\/repos\/php-fig\/http-message\/zipball\/f6561bf28d520154e4b0ec72be95418abe6d9363",
259
  "reference": "f6561bf28d520154e4b0ec72be95418abe6d9363",
260
  "shasum": ""
261
  },
@@ -272,21 +272,21 @@
272
  "installation-source": "dist",
273
  "autoload": {
274
  "psr-4": {
275
- "_PhpScoper5b6804f9734c8\\Psr\\Http\\Message\\": "src\/"
276
  }
277
  },
278
- "notification-url": "https:\/\/packagist.org\/downloads\/",
279
  "license": [
280
  "MIT"
281
  ],
282
  "authors": [
283
  {
284
  "name": "PHP-FIG",
285
- "homepage": "http:\/\/www.php-fig.org\/"
286
  }
287
  ],
288
  "description": "Common interface for HTTP messages",
289
- "homepage": "https:\/\/github.com\/php-fig\/http-message",
290
  "keywords": [
291
  "http",
292
  "http-message",
@@ -296,4 +296,4 @@
296
  "response"
297
  ]
298
  }
299
- ]
1
  [
2
  {
3
+ "name": "composer/ca-bundle",
4
  "version": "1.1.1",
5
  "version_normalized": "1.1.1.0",
6
  "source": {
7
  "type": "git",
8
+ "url": "https://github.com/composer/ca-bundle.git",
9
  "reference": "d2c0a83b7533d6912e8d516756ebd34f893e9169"
10
  },
11
  "dist": {
12
  "type": "zip",
13
+ "url": "https://api.github.com/repos/composer/ca-bundle/zipball/d2c0a83b7533d6912e8d516756ebd34f893e9169",
14
  "reference": "d2c0a83b7533d6912e8d516756ebd34f893e9169",
15
  "shasum": ""
16
  },
20
  "php": "^5.3.2 || ^7.0"
21
  },
22
  "require-dev": {
23
+ "phpunit/phpunit": "^4.8.35 || ^5.7 || ^6.5",
24
+ "psr/log": "^1.0",
25
+ "symfony/process": "^2.5 || ^3.0 || ^4.0"
26
  },
27
  "time": "2018-03-29T19:57:20+00:00",
28
  "type": "library",
34
  "installation-source": "dist",
35
  "autoload": {
36
  "psr-4": {
37
+ "Composer\\CaBundle\\": "src"
38
  }
39
  },
40
+ "notification-url": "https://packagist.org/downloads/",
41
  "license": [
42
  "MIT"
43
  ],
45
  {
46
  "name": "Jordi Boggiano",
47
  "email": "j.boggiano@seld.be",
48
+ "homepage": "http://seld.be"
49
  }
50
  ],
51
  "description": "Lets you find a path to the system CA bundle, and includes a fallback to the Mozilla CA bundle.",
58
  ]
59
  },
60
  {
61
+ "name": "guzzlehttp/guzzle",
62
  "version": "6.3.3",
63
  "version_normalized": "6.3.3.0",
64
  "source": {
65
  "type": "git",
66
+ "url": "https://github.com/guzzle/guzzle.git",
67
  "reference": "407b0cb880ace85c9b63c5f9551db498cb2d50ba"
68
  },
69
  "dist": {
70
  "type": "zip",
71
+ "url": "https://api.github.com/repos/guzzle/guzzle/zipball/407b0cb880ace85c9b63c5f9551db498cb2d50ba",
72
  "reference": "407b0cb880ace85c9b63c5f9551db498cb2d50ba",
73
  "shasum": ""
74
  },
75
  "require": {
76
+ "guzzlehttp/promises": "^1.0",
77
+ "guzzlehttp/psr7": "^1.4",
78
  "php": ">=5.5"
79
  },
80
  "require-dev": {
81
  "ext-curl": "*",
82
+ "phpunit/phpunit": "^4.8.35 || ^5.7 || ^6.4 || ^7.0",
83
+ "psr/log": "^1.0"
84
  },
85
  "suggest": {
86
+ "psr/log": "Required for using the Log middleware"
87
  },
88
  "time": "2018-04-22T15:46:56+00:00",
89
  "type": "library",
95
  "installation-source": "dist",
96
  "autoload": {
97
  "files": [
98
+ "src/functions_include.php"
99
  ],
100
  "psr-4": {
101
+ "GuzzleHttp\\": "src/"
102
  }
103
  },
104
+ "notification-url": "https://packagist.org/downloads/",
105
  "license": [
106
  "MIT"
107
  ],
109
  {
110
  "name": "Michael Dowling",
111
  "email": "mtdowling@gmail.com",
112
+ "homepage": "https://github.com/mtdowling"
113
  }
114
  ],
115
  "description": "Guzzle is a PHP HTTP client library",
116
+ "homepage": "http://guzzlephp.org/",
117
  "keywords": [
118
  "client",
119
  "curl",
125
  ]
126
  },
127
  {
128
+ "name": "guzzlehttp/promises",
129
  "version": "v1.3.1",
130
  "version_normalized": "1.3.1.0",
131
  "source": {
132
  "type": "git",
133
+ "url": "https://github.com/guzzle/promises.git",
134
  "reference": "a59da6cf61d80060647ff4d3eb2c03a2bc694646"
135
  },
136
  "dist": {
137
  "type": "zip",
138
+ "url": "https://api.github.com/repos/guzzle/promises/zipball/a59da6cf61d80060647ff4d3eb2c03a2bc694646",
139
  "reference": "a59da6cf61d80060647ff4d3eb2c03a2bc694646",
140
  "shasum": ""
141
  },
143
  "php": ">=5.5.0"
144
  },
145
  "require-dev": {
146
+ "phpunit/phpunit": "^4.0"
147
  },
148
  "time": "2016-12-20T10:07:11+00:00",
149
  "type": "library",
155
  "installation-source": "dist",
156
  "autoload": {
157
  "psr-4": {
158
+ "GuzzleHttp\\Promise\\": "src/"
159
  },
160
  "files": [
161
+ "src/functions_include.php"
162
  ]
163
  },
164
+ "notification-url": "https://packagist.org/downloads/",
165
  "license": [
166
  "MIT"
167
  ],
169
  {
170
  "name": "Michael Dowling",
171
  "email": "mtdowling@gmail.com",
172
+ "homepage": "https://github.com/mtdowling"
173
  }
174
  ],
175
  "description": "Guzzle promises library",
178
  ]
179
  },
180
  {
181
+ "name": "guzzlehttp/psr7",
182
  "version": "1.4.2",
183
  "version_normalized": "1.4.2.0",
184
  "source": {
185
  "type": "git",
186
+ "url": "https://github.com/guzzle/psr7.git",
187
  "reference": "f5b8a8512e2b58b0071a7280e39f14f72e05d87c"
188
  },
189
  "dist": {
190
  "type": "zip",
191
+ "url": "https://api.github.com/repos/guzzle/psr7/zipball/f5b8a8512e2b58b0071a7280e39f14f72e05d87c",
192
  "reference": "f5b8a8512e2b58b0071a7280e39f14f72e05d87c",
193
  "shasum": ""
194
  },
195
  "require": {
196
  "php": ">=5.4.0",
197
+ "psr/http-message": "~1.0"
198
  },
199
  "provide": {
200
+ "psr/http-message-implementation": "1.0"
201
  },
202
  "require-dev": {
203
+ "phpunit/phpunit": "~4.0"
204
  },
205
  "time": "2017-03-20T17:10:46+00:00",
206
  "type": "library",
212
  "installation-source": "dist",
213
  "autoload": {
214
  "psr-4": {
215
+ "GuzzleHttp\\Psr7\\": "src/"
216
  },
217
  "files": [
218
+ "src/functions_include.php"
219
  ]
220
  },
221
+ "notification-url": "https://packagist.org/downloads/",
222
  "license": [
223
  "MIT"
224
  ],
226
  {
227
  "name": "Michael Dowling",
228
  "email": "mtdowling@gmail.com",
229
+ "homepage": "https://github.com/mtdowling"
230
  },
231
  {
232
  "name": "Tobias Schultze",
233
+ "homepage": "https://github.com/Tobion"
234
  }
235
  ],
236
  "description": "PSR-7 message implementation that also provides common utility methods",
245
  ]
246
  },
247
  {
248
+ "name": "psr/http-message",
249
  "version": "1.0.1",
250
  "version_normalized": "1.0.1.0",
251
  "source": {
252
  "type": "git",
253
+ "url": "https://github.com/php-fig/http-message.git",
254
  "reference": "f6561bf28d520154e4b0ec72be95418abe6d9363"
255
  },
256
  "dist": {
257
  "type": "zip",
258
+ "url": "https://api.github.com/repos/php-fig/http-message/zipball/f6561bf28d520154e4b0ec72be95418abe6d9363",
259
  "reference": "f6561bf28d520154e4b0ec72be95418abe6d9363",
260
  "shasum": ""
261
  },
272
  "installation-source": "dist",
273
  "autoload": {
274
  "psr-4": {
275
+ "Psr\\Http\\Message\\": "src/"
276
  }
277
  },
278
+ "notification-url": "https://packagist.org/downloads/",
279
  "license": [
280
  "MIT"
281
  ],
282
  "authors": [
283
  {
284
  "name": "PHP-FIG",
285
+ "homepage": "http://www.php-fig.org/"
286
  }
287
  ],
288
  "description": "Common interface for HTTP messages",
289
+ "homepage": "https://github.com/php-fig/http-message",
290
  "keywords": [
291
  "http",
292
  "http-message",
296
  "response"
297
  ]
298
  }
299
+ ]
includes/mollie-api-php/vendor/guzzlehttp/guzzle/composer.json CHANGED
@@ -1,54 +1,44 @@
1
  {
2
- "name": "guzzlehttp\/guzzle",
3
  "type": "library",
4
  "description": "Guzzle is a PHP HTTP client library",
5
- "keywords": [
6
- "framework",
7
- "http",
8
- "rest",
9
- "web service",
10
- "curl",
11
- "client",
12
- "HTTP client"
13
- ],
14
- "homepage": "http:\/\/guzzlephp.org\/",
15
  "license": "MIT",
16
  "authors": [
17
  {
18
  "name": "Michael Dowling",
19
  "email": "mtdowling@gmail.com",
20
- "homepage": "https:\/\/github.com\/mtdowling"
21
  }
22
  ],
23
  "require": {
24
  "php": ">=5.5",
25
- "guzzlehttp\/psr7": "^1.4",
26
- "guzzlehttp\/promises": "^1.0"
27
  },
28
  "require-dev": {
29
  "ext-curl": "*",
30
- "phpunit\/phpunit": "^4.8.35 || ^5.7 || ^6.4 || ^7.0",
31
- "psr\/log": "^1.0"
32
  },
33
  "autoload": {
34
- "files": [
35
- "src\/functions_include.php"
36
- ],
37
  "psr-4": {
38
- "_PhpScoper5b6804f9734c8\\GuzzleHttp\\": "src\/"
39
  }
40
  },
41
  "autoload-dev": {
42
  "psr-4": {
43
- "_PhpScoper5b6804f9734c8\\GuzzleHttp\\Tests\\": "tests\/"
44
  }
45
  },
46
  "suggest": {
47
- "psr\/log": "Required for using the Log middleware"
48
  },
49
  "extra": {
50
  "branch-alias": {
51
  "dev-master": "6.3-dev"
52
  }
53
  }
54
- }
1
  {
2
+ "name": "guzzlehttp/guzzle",
3
  "type": "library",
4
  "description": "Guzzle is a PHP HTTP client library",
5
+ "keywords": ["framework", "http", "rest", "web service", "curl", "client", "HTTP client"],
6
+ "homepage": "http://guzzlephp.org/",
 
 
 
 
 
 
 
 
7
  "license": "MIT",
8
  "authors": [
9
  {
10
  "name": "Michael Dowling",
11
  "email": "mtdowling@gmail.com",
12
+ "homepage": "https://github.com/mtdowling"
13
  }
14
  ],
15
  "require": {
16
  "php": ">=5.5",
17
+ "guzzlehttp/psr7": "^1.4",
18
+ "guzzlehttp/promises": "^1.0"
19
  },
20
  "require-dev": {
21
  "ext-curl": "*",
22
+ "phpunit/phpunit": "^4.8.35 || ^5.7 || ^6.4 || ^7.0",
23
+ "psr/log": "^1.0"
24
  },
25
  "autoload": {
26
+ "files": ["src/functions_include.php"],
 
 
27
  "psr-4": {
28
+ "GuzzleHttp\\": "src/"
29
  }
30
  },
31
  "autoload-dev": {
32
  "psr-4": {
33
+ "GuzzleHttp\\Tests\\": "tests/"
34
  }
35
  },
36
  "suggest": {
37
+ "psr/log": "Required for using the Log middleware"
38
  },
39
  "extra": {
40
  "branch-alias": {
41
  "dev-master": "6.3-dev"
42
  }
43
  }
44
+ }
includes/mollie-api-php/vendor/guzzlehttp/guzzle/src/Client.php CHANGED
@@ -1,13 +1,13 @@
1
  <?php
 
2
 
3
- namespace _PhpScoper5b6804f9734c8\GuzzleHttp;
 
 
 
 
 
4
 
5
- use _PhpScoper5b6804f9734c8\GuzzleHttp\Cookie\CookieJar;
6
- use _PhpScoper5b6804f9734c8\GuzzleHttp\Promise;
7
- use _PhpScoper5b6804f9734c8\GuzzleHttp\Psr7;
8
- use _PhpScoper5b6804f9734c8\Psr\Http\Message\UriInterface;
9
- use _PhpScoper5b6804f9734c8\Psr\Http\Message\RequestInterface;
10
- use _PhpScoper5b6804f9734c8\Psr\Http\Message\ResponseInterface;
11
  /**
12
  * @method ResponseInterface get(string|UriInterface $uri, array $options = [])
13
  * @method ResponseInterface head(string|UriInterface $uri, array $options = [])
@@ -22,10 +22,11 @@ use _PhpScoper5b6804f9734c8\Psr\Http\Message\ResponseInterface;
22
  * @method Promise\PromiseInterface patchAsync(string|UriInterface $uri, array $options = [])
23
  * @method Promise\PromiseInterface deleteAsync(string|UriInterface $uri, array $options = [])
24
  */
25
- class Client implements \_PhpScoper5b6804f9734c8\GuzzleHttp\ClientInterface
26
  {
27
  /** @var array Default request options */
28
  private $config;
 
29
  /**
30
  * Clients accept an array of constructor parameters.
31
  *
@@ -61,36 +62,50 @@ class Client implements \_PhpScoper5b6804f9734c8\GuzzleHttp\ClientInterface
61
  public function __construct(array $config = [])
62
  {
63
  if (!isset($config['handler'])) {
64
- $config['handler'] = \_PhpScoper5b6804f9734c8\GuzzleHttp\HandlerStack::create();
65
- } elseif (!\is_callable($config['handler'])) {
66
  throw new \InvalidArgumentException('handler must be a callable');
67
  }
 
68
  // Convert the base_uri to a UriInterface
69
  if (isset($config['base_uri'])) {
70
- $config['base_uri'] = \_PhpScoper5b6804f9734c8\GuzzleHttp\Psr7\uri_for($config['base_uri']);
71
  }
 
72
  $this->configureDefaults($config);
73
  }
 
74
  public function __call($method, $args)
75
  {
76
- if (\count($args) < 1) {
77
  throw new \InvalidArgumentException('Magic request methods require a URI and optional options array');
78
  }
 
79
  $uri = $args[0];
80
  $opts = isset($args[1]) ? $args[1] : [];
81
- return \substr($method, -5) === 'Async' ? $this->requestAsync(\substr($method, 0, -5), $uri, $opts) : $this->request($method, $uri, $opts);
 
 
 
82
  }
83
- public function sendAsync(\_PhpScoper5b6804f9734c8\Psr\Http\Message\RequestInterface $request, array $options = [])
 
84
  {
85
  // Merge the base URI into the request URI if needed.
86
  $options = $this->prepareDefaults($options);
87
- return $this->transfer($request->withUri($this->buildUri($request->getUri(), $options), $request->hasHeader('Host')), $options);
 
 
 
 
88
  }
89
- public function send(\_PhpScoper5b6804f9734c8\Psr\Http\Message\RequestInterface $request, array $options = [])
 
90
  {
91
- $options[\_PhpScoper5b6804f9734c8\GuzzleHttp\RequestOptions::SYNCHRONOUS] = \true;
92
  return $this->sendAsync($request, $options)->wait();
93
  }
 
94
  public function requestAsync($method, $uri = '', array $options = [])
95
  {
96
  $options = $this->prepareDefaults($options);
@@ -100,32 +115,41 @@ class Client implements \_PhpScoper5b6804f9734c8\GuzzleHttp\ClientInterface
100
  $version = isset($options['version']) ? $options['version'] : '1.1';
101
  // Merge the URI into the base URI.
102
  $uri = $this->buildUri($uri, $options);
103
- if (\is_array($body)) {
104
  $this->invalidBody();
105
  }
106
- $request = new \_PhpScoper5b6804f9734c8\GuzzleHttp\Psr7\Request($method, $uri, $headers, $body, $version);
107
  // Remove the option so that they are not doubly-applied.
108
  unset($options['headers'], $options['body'], $options['version']);
 
109
  return $this->transfer($request, $options);
110
  }
 
111
  public function request($method, $uri = '', array $options = [])
112
  {
113
- $options[\_PhpScoper5b6804f9734c8\GuzzleHttp\RequestOptions::SYNCHRONOUS] = \true;
114
  return $this->requestAsync($method, $uri, $options)->wait();
115
  }
 
116
  public function getConfig($option = null)
117
  {
118
- return $option === null ? $this->config : (isset($this->config[$option]) ? $this->config[$option] : null);
 
 
119
  }
 
120
  private function buildUri($uri, array $config)
121
  {
122
  // for BC we accept null which would otherwise fail in uri_for
123
- $uri = \_PhpScoper5b6804f9734c8\GuzzleHttp\Psr7\uri_for($uri === null ? '' : $uri);
 
124
  if (isset($config['base_uri'])) {
125
- $uri = \_PhpScoper5b6804f9734c8\GuzzleHttp\Psr7\UriResolver::resolve(\_PhpScoper5b6804f9734c8\GuzzleHttp\Psr7\uri_for($config['base_uri']), $uri);
126
  }
 
127
  return $uri->getScheme() === '' && $uri->getHost() !== '' ? $uri->withScheme('http') : $uri;
128
  }
 
129
  /**
130
  * Configures the default options for a client.
131
  *
@@ -133,38 +157,52 @@ class Client implements \_PhpScoper5b6804f9734c8\GuzzleHttp\ClientInterface
133
  */
134
  private function configureDefaults(array $config)
135
  {
136
- $defaults = ['allow_redirects' => \_PhpScoper5b6804f9734c8\GuzzleHttp\RedirectMiddleware::$defaultSettings, 'http_errors' => \true, 'decode_content' => \true, 'verify' => \true, 'cookies' => \false];
 
 
 
 
 
 
 
137
  // Use the standard Linux HTTP_PROXY and HTTPS_PROXY if set.
 
138
  // We can only trust the HTTP_PROXY environment variable in a CLI
139
  // process due to the fact that PHP has no reliable mechanism to
140
  // get environment variables that start with "HTTP_".
141
- if (\php_sapi_name() == 'cli' && \getenv('HTTP_PROXY')) {
142
- $defaults['proxy']['http'] = \getenv('HTTP_PROXY');
143
  }
144
- if ($proxy = \getenv('HTTPS_PROXY')) {
 
145
  $defaults['proxy']['https'] = $proxy;
146
  }
147
- if ($noProxy = \getenv('NO_PROXY')) {
148
- $cleanedNoProxy = \str_replace(' ', '', $noProxy);
149
- $defaults['proxy']['no'] = \explode(',', $cleanedNoProxy);
 
150
  }
 
151
  $this->config = $config + $defaults;
152
- if (!empty($config['cookies']) && $config['cookies'] === \true) {
153
- $this->config['cookies'] = new \_PhpScoper5b6804f9734c8\GuzzleHttp\Cookie\CookieJar();
 
154
  }
 
155
  // Add the default user-agent header.
156
  if (!isset($this->config['headers'])) {
157
  $this->config['headers'] = ['User-Agent' => default_user_agent()];
158
  } else {
159
  // Add the User-Agent header if one was not already set.
160
- foreach (\array_keys($this->config['headers']) as $name) {
161
- if (\strtolower($name) === 'user-agent') {
162
  return;
163
  }
164
  }
165
  $this->config['headers']['User-Agent'] = default_user_agent();
166
  }
167
  }
 
168
  /**
169
  * Merges default options into the array.
170
  *
@@ -175,32 +213,38 @@ class Client implements \_PhpScoper5b6804f9734c8\GuzzleHttp\ClientInterface
175
  private function prepareDefaults($options)
176
  {
177
  $defaults = $this->config;
 
178
  if (!empty($defaults['headers'])) {
179
  // Default headers are only added if they are not present.
180
  $defaults['_conditional'] = $defaults['headers'];
181
  unset($defaults['headers']);
182
  }
 
183
  // Special handling for headers is required as they are added as
184
  // conditional headers and as headers passed to a request ctor.
185
- if (\array_key_exists('headers', $options)) {
186
  // Allows default headers to be unset.
187
  if ($options['headers'] === null) {
188
  $defaults['_conditional'] = null;
189
  unset($options['headers']);
190
- } elseif (!\is_array($options['headers'])) {
191
  throw new \InvalidArgumentException('headers must be an array');
192
  }
193
  }
 
194
  // Shallow merge defaults underneath options.
195
  $result = $options + $defaults;
 
196
  // Remove null values.
197
  foreach ($result as $k => $v) {
198
  if ($v === null) {
199
  unset($result[$k]);
200
  }
201
  }
 
202
  return $result;
203
  }
 
204
  /**
205
  * Transfers the given request and applies request options.
206
  *
@@ -212,26 +256,30 @@ class Client implements \_PhpScoper5b6804f9734c8\GuzzleHttp\ClientInterface
212
  *
213
  * @return Promise\PromiseInterface
214
  */
215
- private function transfer(\_PhpScoper5b6804f9734c8\Psr\Http\Message\RequestInterface $request, array $options)
216
  {
217
  // save_to -> sink
218
  if (isset($options['save_to'])) {
219
  $options['sink'] = $options['save_to'];
220
  unset($options['save_to']);
221
  }
 
222
  // exceptions -> http_errors
223
  if (isset($options['exceptions'])) {
224
  $options['http_errors'] = $options['exceptions'];
225
  unset($options['exceptions']);
226
  }
 
227
  $request = $this->applyOptions($request, $options);
228
  $handler = $options['handler'];
 
229
  try {
230
- return \_PhpScoper5b6804f9734c8\GuzzleHttp\Promise\promise_for($handler($request, $options));
231
  } catch (\Exception $e) {
232
- return \_PhpScoper5b6804f9734c8\GuzzleHttp\Promise\rejection_for($e);
233
  }
234
  }
 
235
  /**
236
  * Applies the array of request options to a request.
237
  *
@@ -240,91 +288,112 @@ class Client implements \_PhpScoper5b6804f9734c8\GuzzleHttp\ClientInterface
240
  *
241
  * @return RequestInterface
242
  */
243
- private function applyOptions(\_PhpScoper5b6804f9734c8\Psr\Http\Message\RequestInterface $request, array &$options)
244
  {
245
- $modify = ['set_headers' => []];
 
 
 
246
  if (isset($options['headers'])) {
247
  $modify['set_headers'] = $options['headers'];
248
  unset($options['headers']);
249
  }
 
250
  if (isset($options['form_params'])) {
251
  if (isset($options['multipart'])) {
252
- throw new \InvalidArgumentException('You cannot use ' . 'form_params and multipart at the same time. Use the ' . 'form_params option if you want to send application/' . 'x-www-form-urlencoded requests, and the multipart ' . 'option to send multipart/form-data requests.');
 
 
 
 
253
  }
254
- $options['body'] = \http_build_query($options['form_params'], '', '&');
255
  unset($options['form_params']);
256
  // Ensure that we don't have the header in different case and set the new value.
257
- $options['_conditional'] = \_PhpScoper5b6804f9734c8\GuzzleHttp\Psr7\_caseless_remove(['Content-Type'], $options['_conditional']);
258
  $options['_conditional']['Content-Type'] = 'application/x-www-form-urlencoded';
259
  }
 
260
  if (isset($options['multipart'])) {
261
- $options['body'] = new \_PhpScoper5b6804f9734c8\GuzzleHttp\Psr7\MultipartStream($options['multipart']);
262
  unset($options['multipart']);
263
  }
 
264
  if (isset($options['json'])) {
265
- $options['body'] = \_PhpScoper5b6804f9734c8\GuzzleHttp\json_encode($options['json']);
266
  unset($options['json']);
267
  // Ensure that we don't have the header in different case and set the new value.
268
- $options['_conditional'] = \_PhpScoper5b6804f9734c8\GuzzleHttp\Psr7\_caseless_remove(['Content-Type'], $options['_conditional']);
269
  $options['_conditional']['Content-Type'] = 'application/json';
270
  }
271
- if (!empty($options['decode_content']) && $options['decode_content'] !== \true) {
 
 
 
272
  // Ensure that we don't have the header in different case and set the new value.
273
- $options['_conditional'] = \_PhpScoper5b6804f9734c8\GuzzleHttp\Psr7\_caseless_remove(['Accept-Encoding'], $options['_conditional']);
274
  $modify['set_headers']['Accept-Encoding'] = $options['decode_content'];
275
  }
 
276
  if (isset($options['body'])) {
277
- if (\is_array($options['body'])) {
278
  $this->invalidBody();
279
  }
280
- $modify['body'] = \_PhpScoper5b6804f9734c8\GuzzleHttp\Psr7\stream_for($options['body']);
281
  unset($options['body']);
282
  }
283
- if (!empty($options['auth']) && \is_array($options['auth'])) {
 
284
  $value = $options['auth'];
285
- $type = isset($value[2]) ? \strtolower($value[2]) : 'basic';
286
  switch ($type) {
287
  case 'basic':
288
  // Ensure that we don't have the header in different case and set the new value.
289
- $modify['set_headers'] = \_PhpScoper5b6804f9734c8\GuzzleHttp\Psr7\_caseless_remove(['Authorization'], $modify['set_headers']);
290
- $modify['set_headers']['Authorization'] = 'Basic ' . \base64_encode("{$value[0]}:{$value[1]}");
 
291
  break;
292
  case 'digest':
293
  // @todo: Do not rely on curl
294
- $options['curl'][\CURLOPT_HTTPAUTH] = \CURLAUTH_DIGEST;
295
- $options['curl'][\CURLOPT_USERPWD] = "{$value[0]}:{$value[1]}";
296
  break;
297
  case 'ntlm':
298
- $options['curl'][\CURLOPT_HTTPAUTH] = \CURLAUTH_NTLM;
299
- $options['curl'][\CURLOPT_USERPWD] = "{$value[0]}:{$value[1]}";
300
  break;
301
  }
302
  }
 
303
  if (isset($options['query'])) {
304
  $value = $options['query'];
305
- if (\is_array($value)) {
306
- $value = \http_build_query($value, null, '&', \PHP_QUERY_RFC3986);
307
  }
308
- if (!\is_string($value)) {
309
  throw new \InvalidArgumentException('query must be a string or array');
310
  }
311
  $modify['query'] = $value;
312
  unset($options['query']);
313
  }
 
314
  // Ensure that sink is not an invalid value.
315
  if (isset($options['sink'])) {
316
  // TODO: Add more sink validation?
317
- if (\is_bool($options['sink'])) {
318
  throw new \InvalidArgumentException('sink must not be a boolean');
319
  }
320
  }
321
- $request = \_PhpScoper5b6804f9734c8\GuzzleHttp\Psr7\modify_request($request, $modify);
322
- if ($request->getBody() instanceof \_PhpScoper5b6804f9734c8\GuzzleHttp\Psr7\MultipartStream) {
 
323
  // Use a multipart/form-data POST if a Content-Type is not set.
324
  // Ensure that we don't have the header in different case and set the new value.
325
- $options['_conditional'] = \_PhpScoper5b6804f9734c8\GuzzleHttp\Psr7\_caseless_remove(['Content-Type'], $options['_conditional']);
326
- $options['_conditional']['Content-Type'] = 'multipart/form-data; boundary=' . $request->getBody()->getBoundary();
 
327
  }
 
328
  // Merge in conditional headers if they are not present.
329
  if (isset($options['_conditional'])) {
330
  // Build up the changes so it's in a single clone of the message.
@@ -334,14 +403,20 @@ class Client implements \_PhpScoper5b6804f9734c8\GuzzleHttp\ClientInterface
334
  $modify['set_headers'][$k] = $v;
335
  }
336
  }
337
- $request = \_PhpScoper5b6804f9734c8\GuzzleHttp\Psr7\modify_request($request, $modify);
338
  // Don't pass this internal value along to middleware/handlers.
339
  unset($options['_conditional']);
340
  }
 
341
  return $request;
342
  }
 
343
  private function invalidBody()
344
  {
345
- throw new \InvalidArgumentException('Passing in the "body" request ' . 'option as an array to send a POST request has been deprecated. ' . 'Please use the "form_params" request option to send a ' . 'application/x-www-form-urlencoded request, or the "multipart" ' . 'request option to send a multipart/form-data request.');
 
 
 
 
346
  }
347
  }
1
  <?php
2
+ namespace GuzzleHttp;
3
 
4
+ use GuzzleHttp\Cookie\CookieJar;
5
+ use GuzzleHttp\Promise;
6
+ use GuzzleHttp\Psr7;
7
+ use Psr\Http\Message\UriInterface;
8
+ use Psr\Http\Message\RequestInterface;
9
+ use Psr\Http\Message\ResponseInterface;
10
 
 
 
 
 
 
 
11
  /**
12
  * @method ResponseInterface get(string|UriInterface $uri, array $options = [])
13
  * @method ResponseInterface head(string|UriInterface $uri, array $options = [])
22
  * @method Promise\PromiseInterface patchAsync(string|UriInterface $uri, array $options = [])
23
  * @method Promise\PromiseInterface deleteAsync(string|UriInterface $uri, array $options = [])
24
  */
25
+ class Client implements ClientInterface
26
  {
27
  /** @var array Default request options */
28
  private $config;
29
+
30
  /**
31
  * Clients accept an array of constructor parameters.
32
  *
62
  public function __construct(array $config = [])
63
  {
64
  if (!isset($config['handler'])) {
65
+ $config['handler'] = HandlerStack::create();
66
+ } elseif (!is_callable($config['handler'])) {
67
  throw new \InvalidArgumentException('handler must be a callable');
68
  }
69
+
70
  // Convert the base_uri to a UriInterface
71
  if (isset($config['base_uri'])) {
72
+ $config['base_uri'] = Psr7\uri_for($config['base_uri']);
73
  }
74
+
75
  $this->configureDefaults($config);
76
  }
77
+
78
  public function __call($method, $args)
79
  {
80
+ if (count($args) < 1) {
81
  throw new \InvalidArgumentException('Magic request methods require a URI and optional options array');
82
  }
83
+
84
  $uri = $args[0];
85
  $opts = isset($args[1]) ? $args[1] : [];
86
+
87
+ return substr($method, -5) === 'Async'
88
+ ? $this->requestAsync(substr($method, 0, -5), $uri, $opts)
89
+ : $this->request($method, $uri, $opts);
90
  }
91
+
92
+ public function sendAsync(RequestInterface $request, array $options = [])
93
  {
94
  // Merge the base URI into the request URI if needed.
95
  $options = $this->prepareDefaults($options);
96
+
97
+ return $this->transfer(
98
+ $request->withUri($this->buildUri($request->getUri(), $options), $request->hasHeader('Host')),
99
+ $options
100
+ );
101
  }
102
+
103
+ public function send(RequestInterface $request, array $options = [])
104
  {
105
+ $options[RequestOptions::SYNCHRONOUS] = true;
106
  return $this->sendAsync($request, $options)->wait();
107
  }
108
+
109
  public function requestAsync($method, $uri = '', array $options = [])
110
  {
111
  $options = $this->prepareDefaults($options);
115
  $version = isset($options['version']) ? $options['version'] : '1.1';
116
  // Merge the URI into the base URI.
117
  $uri = $this->buildUri($uri, $options);
118
+ if (is_array($body)) {
119
  $this->invalidBody();
120
  }
121
+ $request = new Psr7\Request($method, $uri, $headers, $body, $version);
122
  // Remove the option so that they are not doubly-applied.
123
  unset($options['headers'], $options['body'], $options['version']);
124
+
125
  return $this->transfer($request, $options);
126
  }
127
+
128
  public function request($method, $uri = '', array $options = [])
129
  {
130
+ $options[RequestOptions::SYNCHRONOUS] = true;
131
  return $this->requestAsync($method, $uri, $options)->wait();
132
  }
133
+
134
  public function getConfig($option = null)
135
  {
136
+ return $option === null
137
+ ? $this->config
138
+ : (isset($this->config[$option]) ? $this->config[$option] : null);
139
  }
140
+
141
  private function buildUri($uri, array $config)
142
  {
143
  // for BC we accept null which would otherwise fail in uri_for
144
+ $uri = Psr7\uri_for($uri === null ? '' : $uri);
145
+
146
  if (isset($config['base_uri'])) {
147
+ $uri = Psr7\UriResolver::resolve(Psr7\uri_for($config['base_uri']), $uri);
148
  }
149
+
150
  return $uri->getScheme() === '' && $uri->getHost() !== '' ? $uri->withScheme('http') : $uri;
151
  }
152
+
153
  /**
154
  * Configures the default options for a client.
155
  *
157
  */
158
  private function configureDefaults(array $config)
159
  {
160
+ $defaults = [
161
+ 'allow_redirects' => RedirectMiddleware::$defaultSettings,
162
+ 'http_errors' => true,
163
+ 'decode_content' => true,
164
+ 'verify' => true,
165
+ 'cookies' => false
166
+ ];
167
+
168
  // Use the standard Linux HTTP_PROXY and HTTPS_PROXY if set.
169
+
170
  // We can only trust the HTTP_PROXY environment variable in a CLI
171
  // process due to the fact that PHP has no reliable mechanism to
172
  // get environment variables that start with "HTTP_".
173
+ if (php_sapi_name() == 'cli' && getenv('HTTP_PROXY')) {
174
+ $defaults['proxy']['http'] = getenv('HTTP_PROXY');
175
  }
176
+
177
+ if ($proxy = getenv('HTTPS_PROXY')) {
178
  $defaults['proxy']['https'] = $proxy;
179
  }
180
+
181
+ if ($noProxy = getenv('NO_PROXY')) {
182
+ $cleanedNoProxy = str_replace(' ', '', $noProxy);
183
+ $defaults['proxy']['no'] = explode(',', $cleanedNoProxy);
184
  }
185
+
186
  $this->config = $config + $defaults;
187
+
188
+ if (!empty($config['cookies']) && $config['cookies'] === true) {
189
+ $this->config['cookies'] = new CookieJar();
190
  }
191
+
192
  // Add the default user-agent header.
193
  if (!isset($this->config['headers'])) {
194
  $this->config['headers'] = ['User-Agent' => default_user_agent()];
195
  } else {
196
  // Add the User-Agent header if one was not already set.
197
+ foreach (array_keys($this->config['headers']) as $name) {
198
+ if (strtolower($name) === 'user-agent') {
199
  return;
200
  }
201
  }
202
  $this->config['headers']['User-Agent'] = default_user_agent();
203
  }
204
  }
205
+
206
  /**
207
  * Merges default options into the array.
208
  *
213
  private function prepareDefaults($options)
214
  {
215
  $defaults = $this->config;
216
+
217
  if (!empty($defaults['headers'])) {
218
  // Default headers are only added if they are not present.
219
  $defaults['_conditional'] = $defaults['headers'];
220
  unset($defaults['headers']);
221
  }
222
+
223
  // Special handling for headers is required as they are added as
224
  // conditional headers and as headers passed to a request ctor.
225
+ if (array_key_exists('headers', $options)) {
226
  // Allows default headers to be unset.
227
  if ($options['headers'] === null) {
228
  $defaults['_conditional'] = null;
229
  unset($options['headers']);
230
+ } elseif (!is_array($options['headers'])) {
231
  throw new \InvalidArgumentException('headers must be an array');
232
  }
233
  }
234
+
235
  // Shallow merge defaults underneath options.
236
  $result = $options + $defaults;
237
+
238
  // Remove null values.
239
  foreach ($result as $k => $v) {
240
  if ($v === null) {
241
  unset($result[$k]);
242
  }
243
  }
244
+
245
  return $result;
246
  }
247
+
248
  /**
249
  * Transfers the given request and applies request options.
250
  *
256
  *
257
  * @return Promise\PromiseInterface
258
  */
259
+ private function transfer(RequestInterface $request, array $options)
260
  {
261
  // save_to -> sink
262
  if (isset($options['save_to'])) {
263
  $options['sink'] = $options['save_to'];
264
  unset($options['save_to']);
265
  }
266
+
267
  // exceptions -> http_errors
268
  if (isset($options['exceptions'])) {
269
  $options['http_errors'] = $options['exceptions'];
270
  unset($options['exceptions']);
271
  }
272
+
273
  $request = $this->applyOptions($request, $options);
274
  $handler = $options['handler'];
275
+
276
  try {
277
+ return Promise\promise_for($handler($request, $options));
278
  } catch (\Exception $e) {
279
+ return Promise\rejection_for($e);
280
  }
281
  }
282
+
283
  /**
284
  * Applies the array of request options to a request.
285
  *
288
  *
289
  * @return RequestInterface
290
  */
291
+ private function applyOptions(RequestInterface $request, array &$options)
292
  {
293
+ $modify = [
294
+ 'set_headers' => [],
295
+ ];
296
+
297
  if (isset($options['headers'])) {
298
  $modify['set_headers'] = $options['headers'];
299
  unset($options['headers']);
300
  }
301
+
302
  if (isset($options['form_params'])) {
303
  if (isset($options['multipart'])) {
304
+ throw new \InvalidArgumentException('You cannot use '
305
+ . 'form_params and multipart at the same time. Use the '
306
+ . 'form_params option if you want to send application/'
307
+ . 'x-www-form-urlencoded requests, and the multipart '
308
+ . 'option to send multipart/form-data requests.');
309
  }
310
+ $options['body'] = http_build_query($options['form_params'], '', '&');
311
  unset($options['form_params']);
312
  // Ensure that we don't have the header in different case and set the new value.
313
+ $options['_conditional'] = Psr7\_caseless_remove(['Content-Type'], $options['_conditional']);
314
  $options['_conditional']['Content-Type'] = 'application/x-www-form-urlencoded';
315
  }
316
+
317
  if (isset($options['multipart'])) {
318
+ $options['body'] = new Psr7\MultipartStream($options['multipart']);
319
  unset($options['multipart']);
320
  }
321
+
322
  if (isset($options['json'])) {
323
+ $options['body'] = \GuzzleHttp\json_encode($options['json']);
324
  unset($options['json']);
325
  // Ensure that we don't have the header in different case and set the new value.
326
+ $options['_conditional'] = Psr7\_caseless_remove(['Content-Type'], $options['_conditional']);
327
  $options['_conditional']['Content-Type'] = 'application/json';
328
  }
329
+
330
+ if (!empty($options['decode_content'])
331
+ && $options['decode_content'] !== true
332
+ ) {
333
  // Ensure that we don't have the header in different case and set the new value.
334
+ $options['_conditional'] = Psr7\_caseless_remove(['Accept-Encoding'], $options['_conditional']);
335
  $modify['set_headers']['Accept-Encoding'] = $options['decode_content'];
336
  }
337
+
338
  if (isset($options['body'])) {
339
+ if (is_array($options['body'])) {
340
  $this->invalidBody();
341
  }
342
+ $modify['body'] = Psr7\stream_for($options['body']);
343
  unset($options['body']);
344
  }
345
+
346
+ if (!empty($options['auth']) && is_array($options['auth'])) {
347
  $value = $options['auth'];
348
+ $type = isset($value[2]) ? strtolower($value[2]) : 'basic';
349
  switch ($type) {
350
  case 'basic':
351
  // Ensure that we don't have the header in different case and set the new value.
352
+ $modify['set_headers'] = Psr7\_caseless_remove(['Authorization'], $modify['set_headers']);
353
+ $modify['set_headers']['Authorization'] = 'Basic '
354
+ . base64_encode("$value[0]:$value[1]");
355
  break;
356
  case 'digest':
357
  // @todo: Do not rely on curl
358
+ $options['curl'][CURLOPT_HTTPAUTH] = CURLAUTH_DIGEST;
359
+ $options['curl'][CURLOPT_USERPWD] = "$value[0]:$value[1]";
360
  break;
361
  case 'ntlm':
362
+ $options['curl'][CURLOPT_HTTPAUTH] = CURLAUTH_NTLM;
363
+ $options['curl'][CURLOPT_USERPWD] = "$value[0]:$value[1]";
364
  break;
365
  }
366
  }
367
+
368
  if (isset($options['query'])) {
369
  $value = $options['query'];
370
+ if (is_array($value)) {
371
+ $value = http_build_query($value, null, '&', PHP_QUERY_RFC3986);
372
  }
373
+ if (!is_string($value)) {
374
  throw new \InvalidArgumentException('query must be a string or array');
375
  }
376
  $modify['query'] = $value;
377
  unset($options['query']);
378
  }
379
+
380
  // Ensure that sink is not an invalid value.
381
  if (isset($options['sink'])) {
382
  // TODO: Add more sink validation?
383
+ if (is_bool($options['sink'])) {
384
  throw new \InvalidArgumentException('sink must not be a boolean');
385
  }
386
  }
387
+
388
+ $request = Psr7\modify_request($request, $modify);
389
+ if ($request->getBody() instanceof Psr7\MultipartStream) {
390
  // Use a multipart/form-data POST if a Content-Type is not set.
391
  // Ensure that we don't have the header in different case and set the new value.
392
+ $options['_conditional'] = Psr7\_caseless_remove(['Content-Type'], $options['_conditional']);
393
+ $options['_conditional']['Content-Type'] = 'multipart/form-data; boundary='
394
+ . $request->getBody()->getBoundary();
395
  }
396
+
397
  // Merge in conditional headers if they are not present.
398
  if (isset($options['_conditional'])) {
399
  // Build up the changes so it's in a single clone of the message.
403
  $modify['set_headers'][$k] = $v;
404
  }
405
  }
406
+ $request = Psr7\modify_request($request, $modify);
407
  // Don't pass this internal value along to middleware/handlers.
408
  unset($options['_conditional']);
409
  }
410
+
411
  return $request;
412
  }
413
+
414
  private function invalidBody()
415
  {
416
+ throw new \InvalidArgumentException('Passing in the "body" request '
417
+ . 'option as an array to send a POST request has been deprecated. '
418
+ . 'Please use the "form_params" request option to send a '
419
+ . 'application/x-www-form-urlencoded request, or the "multipart" '
420
+ . 'request option to send a multipart/form-data request.');
421
  }
422
  }
includes/mollie-api-php/vendor/guzzlehttp/guzzle/src/ClientInterface.php CHANGED
@@ -1,18 +1,19 @@
1
  <?php
 
2
 
3
- namespace _PhpScoper5b6804f9734c8\GuzzleHttp;
 
 
 
 
4
 
5
- use _PhpScoper5b6804f9734c8\GuzzleHttp\Promise\PromiseInterface;
6
- use _PhpScoper5b6804f9734c8\GuzzleHttp\Exception\GuzzleException;
7
- use _PhpScoper5b6804f9734c8\Psr\Http\Message\RequestInterface;
8
- use _PhpScoper5b6804f9734c8\Psr\Http\Message\ResponseInterface;
9
- use _PhpScoper5b6804f9734c8\Psr\Http\Message\UriInterface;
10
  /**
11
  * Client interface for sending HTTP requests.
12
  */
13
  interface ClientInterface
14
  {
15
  const VERSION = '6.3.3';
 
16
  /**
17
  * Send an HTTP request.
18
  *
@@ -23,7 +24,8 @@ interface ClientInterface
23
  * @return ResponseInterface
24
  * @throws GuzzleException
25
  */
26
- public function send(\_PhpScoper5b6804f9734c8\Psr\Http\Message\RequestInterface $request, array $options = []);
 
27
  /**
28
  * Asynchronously send an HTTP request.
29
  *
@@ -33,7 +35,8 @@ interface ClientInterface
33
  *
34
  * @return PromiseInterface
35
  */
36
- public function sendAsync(\_PhpScoper5b6804f9734c8\Psr\Http\Message\RequestInterface $request, array $options = []);
 
37
  /**
38
  * Create and send an HTTP request.
39
  *
@@ -49,6 +52,7 @@ interface ClientInterface
49
  * @throws GuzzleException
50
  */
51
  public function request($method, $uri, array $options = []);
 
52
  /**
53
  * Create and send an asynchronous HTTP request.
54
  *
@@ -64,6 +68,7 @@ interface ClientInterface
64
  * @return PromiseInterface
65
  */
66
  public function requestAsync($method, $uri, array $options = []);
 
67
  /**
68
  * Get a client configuration option.
69
  *
@@ -77,7 +82,3 @@ interface ClientInterface
77
  */
78
  public function getConfig($option = null);
79
  }
80
- /**
81
- * Client interface for sending HTTP requests.
82
- */
83
- \class_alias('_PhpScoper5b6804f9734c8\\GuzzleHttp\\ClientInterface', 'GuzzleHttp\\ClientInterface', \false);
1
  <?php
2
+ namespace GuzzleHttp;
3
 
4
+ use GuzzleHttp\Promise\PromiseInterface;
5
+ use GuzzleHttp\Exception\GuzzleException;
6
+ use Psr\Http\Message\RequestInterface;
7
+ use Psr\Http\Message\ResponseInterface;
8
+ use Psr\Http\Message\UriInterface;
9
 
 
 
 
 
 
10
  /**
11
  * Client interface for sending HTTP requests.
12
  */
13
  interface ClientInterface
14
  {
15
  const VERSION = '6.3.3';
16
+
17
  /**
18
  * Send an HTTP request.
19
  *
24
  * @return ResponseInterface
25
  * @throws GuzzleException
26
  */
27
+ public function send(RequestInterface $request, array $options = []);
28
+
29
  /**
30
  * Asynchronously send an HTTP request.
31
  *
35
  *
36
  * @return PromiseInterface
37
  */
38
+ public function sendAsync(RequestInterface $request, array $options = []);
39
+
40
  /**
41
  * Create and send an HTTP request.
42
  *
52
  * @throws GuzzleException
53
  */
54
  public function request($method, $uri, array $options = []);
55
+
56
  /**
57
  * Create and send an asynchronous HTTP request.
58
  *
68
  * @return PromiseInterface
69
  */
70
  public function requestAsync($method, $uri, array $options = []);
71
+
72
  /**
73
  * Get a client configuration option.
74
  *
82
  */
83
  public function getConfig($option = null);
84
  }
 
 
 
 
includes/mollie-api-php/vendor/guzzlehttp/guzzle/src/Cookie/CookieJar.php CHANGED
@@ -1,18 +1,20 @@
1
  <?php
 
2
 
3
- namespace _PhpScoper5b6804f9734c8\GuzzleHttp\Cookie;
 
4
 
5
- use _PhpScoper5b6804f9734c8\Psr\Http\Message\RequestInterface;
6
- use _PhpScoper5b6804f9734c8\Psr\Http\Message\ResponseInterface;
7
  /**
8
  * Cookie jar that stores cookies as an array
9
  */
10
- class CookieJar implements \_PhpScoper5b6804f9734c8\GuzzleHttp\Cookie\CookieJarInterface
11
  {
12
  /** @var SetCookie[] Loaded cookie data */
13
  private $cookies = [];
 
14
  /** @var bool */
15
  private $strictMode;
 
16
  /**
17
  * @param bool $strictMode Set to true to throw exceptions when invalid
18
  * cookies are added to the cookie jar.
@@ -20,16 +22,18 @@ class CookieJar implements \_PhpScoper5b6804f9734c8\GuzzleHttp\Cookie\CookieJarI
20
  * arrays that can be used with the SetCookie
21
  * constructor
22
  */
23
- public function __construct($strictMode = \false, $cookieArray = [])
24
  {
25
  $this->strictMode = $strictMode;
 
26
  foreach ($cookieArray as $cookie) {
27
- if (!$cookie instanceof \_PhpScoper5b6804f9734c8\GuzzleHttp\Cookie\SetCookie) {
28
- $cookie = new \_PhpScoper5b6804f9734c8\GuzzleHttp\Cookie\SetCookie($cookie);
29
  }
30
  $this->setCookie($cookie);
31
  }
32
  }
 
33
  /**
34
  * Create a new Cookie jar from an associative array and domain.
35
  *
@@ -42,10 +46,17 @@ class CookieJar implements \_PhpScoper5b6804f9734c8\GuzzleHttp\Cookie\CookieJarI
42
  {
43
  $cookieJar = new self();
44
  foreach ($cookies as $name => $value) {
45
- $cookieJar->setCookie(new \_PhpScoper5b6804f9734c8\GuzzleHttp\Cookie\SetCookie(['Domain' => $domain, 'Name' => $name, 'Value' => $value, 'Discard' => \true]));
 
 
 
 
 
46
  }
 
47
  return $cookieJar;
48
  }
 
49
  /**
50
  * @deprecated
51
  */
@@ -53,6 +64,7 @@ class CookieJar implements \_PhpScoper5b6804f9734c8\GuzzleHttp\Cookie\CookieJarI
53
  {
54
  return $value;
55
  }
 
56
  /**
57
  * Evaluate if this cookie should be persisted to storage
58
  * that survives between requests.
@@ -61,15 +73,19 @@ class CookieJar implements \_PhpScoper5b6804f9734c8\GuzzleHttp\Cookie\CookieJarI
61
  * @param bool $allowSessionCookies If we should persist session cookies
62
  * @return bool
63
  */
64
- public static function shouldPersist(\_PhpScoper5b6804f9734c8\GuzzleHttp\Cookie\SetCookie $cookie, $allowSessionCookies = \false)
65
- {
 
 
66
  if ($cookie->getExpires() || $allowSessionCookies) {
67
  if (!$cookie->getDiscard()) {
68
- return \true;
69
  }
70
  }
71
- return \false;
 
72
  }
 
73
  /**
74
  * Finds and returns the cookie based on the name
75
  *
@@ -83,113 +99,150 @@ class CookieJar implements \_PhpScoper5b6804f9734c8\GuzzleHttp\Cookie\CookieJarI
83
  return null;
84
  }
85
  foreach ($this->cookies as $cookie) {
86
- if ($cookie->getName() !== null && \strcasecmp($cookie->getName(), $name) === 0) {
87
  return $cookie;
88
  }
89
  }
90
  }
 
91
  public function toArray()
92
  {
93
- return \array_map(function (\_PhpScoper5b6804f9734c8\GuzzleHttp\Cookie\SetCookie $cookie) {
94
  return $cookie->toArray();
95
  }, $this->getIterator()->getArrayCopy());
96
  }
 
97
  public function clear($domain = null, $path = null, $name = null)
98
  {
99
  if (!$domain) {
100
  $this->cookies = [];
101
  return;
102
  } elseif (!$path) {
103
- $this->cookies = \array_filter($this->cookies, function (\_PhpScoper5b6804f9734c8\GuzzleHttp\Cookie\SetCookie $cookie) use($path, $domain) {
104
- return !$cookie->matchesDomain($domain);
105
- });
 
 
 
106
  } elseif (!$name) {
107
- $this->cookies = \array_filter($this->cookies, function (\_PhpScoper5b6804f9734c8\GuzzleHttp\Cookie\SetCookie $cookie) use($path, $domain) {
108
- return !($cookie->matchesPath($path) && $cookie->matchesDomain($domain));
109
- });
 
 
 
 
110
  } else {
111
- $this->cookies = \array_filter($this->cookies, function (\_PhpScoper5b6804f9734c8\GuzzleHttp\Cookie\SetCookie $cookie) use($path, $domain, $name) {
112
- return !($cookie->getName() == $name && $cookie->matchesPath($path) && $cookie->matchesDomain($domain));
113
- });
 
 
 
 
 
114
  }
115
  }
 
116
  public function clearSessionCookies()
117
  {
118
- $this->cookies = \array_filter($this->cookies, function (\_PhpScoper5b6804f9734c8\GuzzleHttp\Cookie\SetCookie $cookie) {
119
- return !$cookie->getDiscard() && $cookie->getExpires();
120
- });
 
 
 
121
  }
122
- public function setCookie(\_PhpScoper5b6804f9734c8\GuzzleHttp\Cookie\SetCookie $cookie)
 
123
  {
124
  // If the name string is empty (but not 0), ignore the set-cookie
125
  // string entirely.
126
  $name = $cookie->getName();
127
  if (!$name && $name !== '0') {
128
- return \false;
129
  }
 
130
  // Only allow cookies with set and valid domain, name, value
131
  $result = $cookie->validate();
132
- if ($result !== \true) {
133
  if ($this->strictMode) {
134
  throw new \RuntimeException('Invalid cookie: ' . $result);
135
  } else {
136
  $this->removeCookieIfEmpty($cookie);
137
- return \false;
138
  }
139
  }
 
140
  // Resolve conflicts with previously set cookies
141
  foreach ($this->cookies as $i => $c) {
 
142
  // Two cookies are identical, when their path, and domain are
143
  // identical.
144
- if ($c->getPath() != $cookie->getPath() || $c->getDomain() != $cookie->getDomain() || $c->getName() != $cookie->getName()) {
 
 
 
145
  continue;
146
  }
 
147
  // The previously set cookie is a discard cookie and this one is
148
  // not so allow the new cookie to be set
149
  if (!$cookie->getDiscard() && $c->getDiscard()) {
150
  unset($this->cookies[$i]);
151
  continue;
152
  }
 
153
  // If the new cookie's expiration is further into the future, then
154
  // replace the old cookie
155
  if ($cookie->getExpires() > $c->getExpires()) {
156
  unset($this->cookies[$i]);
157
  continue;
158
  }
 
159
  // If the value has changed, we better change it
160
  if ($cookie->getValue() !== $c->getValue()) {
161
  unset($this->cookies[$i]);
162
  continue;
163
  }
 
164
  // The cookie exists, so no need to continue
165
- return \false;
166
  }
 
167
  $this->cookies[] = $cookie;
168
- return \true;
 
169
  }
 
170
  public function count()
171
  {
172
- return \count($this->cookies);
173
  }
 
174
  public function getIterator()
175
  {
176
- return new \ArrayIterator(\array_values($this->cookies));
177
  }
178
- public function extractCookies(\_PhpScoper5b6804f9734c8\Psr\Http\Message\RequestInterface $request, \_PhpScoper5b6804f9734c8\Psr\Http\Message\ResponseInterface $response)
179
- {
 
 
 
180
  if ($cookieHeader = $response->getHeader('Set-Cookie')) {
181
  foreach ($cookieHeader as $cookie) {
182
- $sc = \_PhpScoper5b6804f9734c8\GuzzleHttp\Cookie\SetCookie::fromString($cookie);
183
  if (!$sc->getDomain()) {
184
  $sc->setDomain($request->getUri()->getHost());
185
  }
186
- if (0 !== \strpos($sc->getPath(), '/')) {
187
  $sc->setPath($this->getCookiePathFromRequest($request));
188
  }
189
  $this->setCookie($sc);
190
  }
191
  }
192
  }
 
193
  /**
194
  * Computes cookie path following RFC 6265 section 5.1.4
195
  *
@@ -198,48 +251,64 @@ class CookieJar implements \_PhpScoper5b6804f9734c8\GuzzleHttp\Cookie\CookieJarI
198
  * @param RequestInterface $request
199
  * @return string
200
  */
201
- private function getCookiePathFromRequest(\_PhpScoper5b6804f9734c8\Psr\Http\Message\RequestInterface $request)
202
  {
203
  $uriPath = $request->getUri()->getPath();
204
- if ('' === $uriPath) {
205
  return '/';
206
  }
207
- if (0 !== \strpos($uriPath, '/')) {
208
  return '/';
209
  }
210
  if ('/' === $uriPath) {
211
  return '/';
212
  }
213
- if (0 === ($lastSlashPos = \strrpos($uriPath, '/'))) {
214
  return '/';
215
  }
216
- return \substr($uriPath, 0, $lastSlashPos);
 
217
  }
218
- public function withCookieHeader(\_PhpScoper5b6804f9734c8\Psr\Http\Message\RequestInterface $request)
 
219
  {
220
  $values = [];
221
  $uri = $request->getUri();
222
  $scheme = $uri->getScheme();
223
  $host = $uri->getHost();
224
  $path = $uri->getPath() ?: '/';
 
225
  foreach ($this->cookies as $cookie) {
226
- if ($cookie->matchesPath($path) && $cookie->matchesDomain($host) && !$cookie->isExpired() && (!$cookie->getSecure() || $scheme === 'https')) {
227
- $values[] = $cookie->getName() . '=' . $cookie->getValue();
 
 
 
 
 
228
  }
229
  }
230
- return $values ? $request->withHeader('Cookie', \implode('; ', $values)) : $request;
 
 
 
231
  }
 
232
  /**
233
  * If a cookie already exists and the server asks to set it again with a
234
  * null value, the cookie must be deleted.
235
  *
236
  * @param SetCookie $cookie
237
  */
238
- private function removeCookieIfEmpty(\_PhpScoper5b6804f9734c8\GuzzleHttp\Cookie\SetCookie $cookie)
239
  {
240
  $cookieValue = $cookie->getValue();
241
  if ($cookieValue === null || $cookieValue === '') {
242
- $this->clear($cookie->getDomain(), $cookie->getPath(), $cookie->getName());
 
 
 
 
243
  }
244
  }
245
  }
1
  <?php
2
+ namespace GuzzleHttp\Cookie;
3
 
4
+ use Psr\Http\Message\RequestInterface;
5
+ use Psr\Http\Message\ResponseInterface;
6
 
 
 
7
  /**
8
  * Cookie jar that stores cookies as an array
9
  */
10
+ class CookieJar implements CookieJarInterface
11
  {
12
  /** @var SetCookie[] Loaded cookie data */
13
  private $cookies = [];
14
+
15
  /** @var bool */
16
  private $strictMode;
17
+
18
  /**
19
  * @param bool $strictMode Set to true to throw exceptions when invalid
20
  * cookies are added to the cookie jar.
22
  * arrays that can be used with the SetCookie
23
  * constructor
24
  */
25
+ public function __construct($strictMode = false, $cookieArray = [])
26
  {
27
  $this->strictMode = $strictMode;
28
+
29
  foreach ($cookieArray as $cookie) {
30
+ if (!($cookie instanceof SetCookie)) {
31
+ $cookie = new SetCookie($cookie);
32
  }
33
  $this->setCookie($cookie);
34
  }
35
  }
36
+
37
  /**
38
  * Create a new Cookie jar from an associative array and domain.
39
  *
46
  {
47
  $cookieJar = new self();
48
  foreach ($cookies as $name => $value) {
49
+ $cookieJar->setCookie(new SetCookie([
50
+ 'Domain' => $domain,
51
+ 'Name' => $name,
52
+ 'Value' => $value,
53
+ 'Discard' => true
54
+ ]));
55
  }
56
+
57
  return $cookieJar;
58
  }
59
+
60
  /**
61
  * @deprecated
62
  */
64
  {
65
  return $value;
66
  }
67
+
68
  /**
69
  * Evaluate if this cookie should be persisted to storage
70
  * that survives between requests.
73
  * @param bool $allowSessionCookies If we should persist session cookies
74
  * @return bool
75
  */
76
+ public static function shouldPersist(
77
+ SetCookie $cookie,
78
+ $allowSessionCookies = false
79
+ ) {
80
  if ($cookie->getExpires() || $allowSessionCookies) {
81
  if (!$cookie->getDiscard()) {
82
+ return true;
83
  }
84
  }
85
+
86
+ return false;
87
  }
88
+
89
  /**
90
  * Finds and returns the cookie based on the name
91
  *
99
  return null;
100
  }
101
  foreach ($this->cookies as $cookie) {
102
+ if ($cookie->getName() !== null && strcasecmp($cookie->getName(), $name) === 0) {
103
  return $cookie;
104
  }
105
  }
106
  }
107
+
108
  public function toArray()
109
  {
110
+ return array_map(function (SetCookie $cookie) {
111
  return $cookie->toArray();
112
  }, $this->getIterator()->getArrayCopy());
113
  }
114
+
115
  public function clear($domain = null, $path = null, $name = null)
116
  {
117
  if (!$domain) {
118
  $this->cookies = [];
119
  return;
120
  } elseif (!$path) {
121
+ $this->cookies = array_filter(
122
+ $this->cookies,
123
+ function (SetCookie $cookie) use ($path, $domain) {
124
+ return !$cookie->matchesDomain($domain);
125
+ }
126
+ );
127
  } elseif (!$name) {
128
+ $this->cookies = array_filter(
129
+ $this->cookies,
130
+ function (SetCookie $cookie) use ($path, $domain) {
131
+ return !($cookie->matchesPath($path) &&
132
+ $cookie->matchesDomain($domain));
133
+ }
134
+ );
135
  } else {
136
+ $this->cookies = array_filter(
137
+ $this->cookies,
138
+ function (SetCookie $cookie) use ($path, $domain, $name) {
139
+ return !($cookie->getName() == $name &&
140
+ $cookie->matchesPath($path) &&
141
+ $cookie->matchesDomain($domain));
142
+ }
143
+ );
144
  }
145
  }
146
+
147
  public function clearSessionCookies()
148
  {
149
+ $this->cookies = array_filter(
150
+ $this->cookies,
151
+ function (SetCookie $cookie) {
152
+ return !$cookie->getDiscard() && $cookie->getExpires();
153
+ }
154
+ );
155
  }
156
+
157
+ public function setCookie(SetCookie $cookie)
158
  {
159
  // If the name string is empty (but not 0), ignore the set-cookie
160
  // string entirely.
161
  $name = $cookie->getName();
162
  if (!$name && $name !== '0') {
163
+ return false;
164
  }
165
+
166
  // Only allow cookies with set and valid domain, name, value
167
  $result = $cookie->validate();
168
+ if ($result !== true) {
169
  if ($this->strictMode) {
170
  throw new \RuntimeException('Invalid cookie: ' . $result);
171
  } else {
172
  $this->removeCookieIfEmpty($cookie);
173
+ return false;
174
  }
175
  }
176
+
177
  // Resolve conflicts with previously set cookies
178
  foreach ($this->cookies as $i => $c) {
179
+
180
  // Two cookies are identical, when their path, and domain are
181
  // identical.
182
+ if ($c->getPath() != $cookie->getPath() ||
183
+ $c->getDomain() != $cookie->getDomain() ||
184
+ $c->getName() != $cookie->getName()
185
+ ) {
186
  continue;
187
  }
188
+
189
  // The previously set cookie is a discard cookie and this one is
190
  // not so allow the new cookie to be set
191
  if (!$cookie->getDiscard() && $c->getDiscard()) {
192
  unset($this->cookies[$i]);
193
  continue;
194
  }
195
+
196
  // If the new cookie's expiration is further into the future, then
197
  // replace the old cookie
198
  if ($cookie->getExpires() > $c->getExpires()) {
199
  unset($this->cookies[$i]);
200
  continue;
201
  }
202
+
203
  // If the value has changed, we better change it
204
  if ($cookie->getValue() !== $c->getValue()) {
205
  unset($this->cookies[$i]);
206
  continue;
207
  }
208
+
209
  // The cookie exists, so no need to continue
210
+ return false;
211
  }
212
+
213
  $this->cookies[] = $cookie;
214
+
215
+ return true;
216
  }
217
+
218
  public function count()
219
  {
220
+ return count($this->cookies);
221
  }
222
+
223
  public function getIterator()
224
  {
225
+ return new \ArrayIterator(array_values($this->cookies));
226
  }
227
+
228
+ public function extractCookies(
229
+ RequestInterface $request,
230
+ ResponseInterface $response
231
+ ) {
232
  if ($cookieHeader = $response->getHeader('Set-Cookie')) {
233
  foreach ($cookieHeader as $cookie) {
234
+ $sc = SetCookie::fromString($cookie);
235
  if (!$sc->getDomain()) {
236
  $sc->setDomain($request->getUri()->getHost());
237
  }
238
+ if (0 !== strpos($sc->getPath(), '/')) {
239
  $sc->setPath($this->getCookiePathFromRequest($request));
240
  }
241
  $this->setCookie($sc);
242
  }
243
  }
244
  }
245
+
246
  /**
247
  * Computes cookie path following RFC 6265 section 5.1.4
248
  *
251
  * @param RequestInterface $request
252
  * @return string
253
  */
254
+ private function getCookiePathFromRequest(RequestInterface $request)
255
  {
256
  $uriPath = $request->getUri()->getPath();
257
+ if ('' === $uriPath) {
258
  return '/';
259
  }
260
+ if (0 !== strpos($uriPath, '/')) {
261
  return '/';
262
  }
263
  if ('/' === $uriPath) {
264
  return '/';
265
  }
266
+ if (0 === $lastSlashPos = strrpos($uriPath, '/')) {
267
  return '/';
268
  }
269
+
270
+ return substr($uriPath, 0, $lastSlashPos);
271
  }
272
+
273
+ public function withCookieHeader(RequestInterface $request)
274
  {
275
  $values = [];
276
  $uri = $request->getUri();
277
  $scheme = $uri->getScheme();
278
  $host = $uri->getHost();
279
  $path = $uri->getPath() ?: '/';
280
+
281
  foreach ($this->cookies as $cookie) {
282
+ if ($cookie->matchesPath($path) &&
283
+ $cookie->matchesDomain($host) &&
284
+ !$cookie->isExpired() &&
285
+ (!$cookie->getSecure() || $scheme === 'https')
286
+ ) {
287
+ $values[] = $cookie->getName() . '='
288
+ . $cookie->getValue();
289
  }
290
  }
291
+
292
+ return $values
293
+ ? $request->withHeader('Cookie', implode('; ', $values))
294
+ : $request;
295
  }
296
+
297
  /**
298
  * If a cookie already exists and the server asks to set it again with a
299
  * null value, the cookie must be deleted.
300
  *
301
  * @param SetCookie $cookie
302
  */
303
+ private function removeCookieIfEmpty(SetCookie $cookie)
304
  {
305
  $cookieValue = $cookie->getValue();
306
  if ($cookieValue === null || $cookieValue === '') {
307
+ $this->clear(
308
+ $cookie->getDomain(),
309
+ $cookie->getPath(),
310
+ $cookie->getName()
311
+ );
312
  }
313
  }
314
  }
includes/mollie-api-php/vendor/guzzlehttp/guzzle/src/Cookie/CookieJarInterface.php CHANGED
@@ -1,9 +1,9 @@
1
  <?php
 
2
 
3
- namespace _PhpScoper5b6804f9734c8\GuzzleHttp\Cookie;
 
4
 
5
- use _PhpScoper5b6804f9734c8\Psr\Http\Message\RequestInterface;
6
- use _PhpScoper5b6804f9734c8\Psr\Http\Message\ResponseInterface;
7
  /**
8
  * Stores HTTP cookies.
9
  *
@@ -26,14 +26,19 @@ interface CookieJarInterface extends \Countable, \IteratorAggregate
26
  *
27
  * @return RequestInterface returns the modified request.
28
  */
29
- public function withCookieHeader(\_PhpScoper5b6804f9734c8\Psr\Http\Message\RequestInterface $request);
 
30
  /**
31
  * Extract cookies from an HTTP response and store them in the CookieJar.
32
  *
33
  * @param RequestInterface $request Request that was sent
34
  * @param ResponseInterface $response Response that was received
35
  */
36
- public function extractCookies(\_PhpScoper5b6804f9734c8\Psr\Http\Message\RequestInterface $request, \_PhpScoper5b6804f9734c8\Psr\Http\Message\ResponseInterface $response);
 
 
 
 
37
  /**
38
  * Sets a cookie in the cookie jar.
39
  *
@@ -41,7 +46,8 @@ interface CookieJarInterface extends \Countable, \IteratorAggregate
41
  *
42
  * @return bool Returns true on success or false on failure
43
  */
44
- public function setCookie(\_PhpScoper5b6804f9734c8\GuzzleHttp\Cookie\SetCookie $cookie);
 
45
  /**
46
  * Remove cookies currently held in the cookie jar.
47
  *
@@ -59,6 +65,7 @@ interface CookieJarInterface extends \Countable, \IteratorAggregate
59
  * @return CookieJarInterface
60
  */
61
  public function clear($domain = null, $path = null, $name = null);
 
62
  /**
63
  * Discard all sessions cookies.
64
  *
@@ -67,6 +74,7 @@ interface CookieJarInterface extends \Countable, \IteratorAggregate
67
  * to RFC 2965.
68
  */
69
  public function clearSessionCookies();
 
70
  /**
71
  * Converts the cookie jar to an array.
72
  *
1
  <?php
2
+ namespace GuzzleHttp\Cookie;
3
 
4
+ use Psr\Http\Message\RequestInterface;
5
+ use Psr\Http\Message\ResponseInterface;
6
 
 
 
7
  /**
8
  * Stores HTTP cookies.
9
  *
26
  *
27
  * @return RequestInterface returns the modified request.
28
  */
29
+ public function withCookieHeader(RequestInterface $request);
30
+
31
  /**
32
  * Extract cookies from an HTTP response and store them in the CookieJar.
33
  *
34
  * @param RequestInterface $request Request that was sent
35
  * @param ResponseInterface $response Response that was received
36
  */
37
+ public function extractCookies(
38
+ RequestInterface $request,
39
+ ResponseInterface $response
40
+ );
41
+
42
  /**
43
  * Sets a cookie in the cookie jar.
44
  *
46
  *
47
  * @return bool Returns true on success or false on failure
48
  */
49
+ public function setCookie(SetCookie $cookie);
50
+
51
  /**
52
  * Remove cookies currently held in the cookie jar.
53
  *
65
  * @return CookieJarInterface
66
  */
67
  public function clear($domain = null, $path = null, $name = null);
68
+
69
  /**
70
  * Discard all sessions cookies.
71
  *
74
  * to RFC 2965.
75
  */
76
  public function clearSessionCookies();
77
+
78
  /**
79
  * Converts the cookie jar to an array.
80
  *
includes/mollie-api-php/vendor/guzzlehttp/guzzle/src/Cookie/FileCookieJar.php CHANGED
@@ -1,16 +1,17 @@
1
  <?php
2
-
3
- namespace _PhpScoper5b6804f9734c8\GuzzleHttp\Cookie;
4
 
5
  /**
6
  * Persists non-session cookies using a JSON formatted file
7
  */
8
- class FileCookieJar extends \_PhpScoper5b6804f9734c8\GuzzleHttp\Cookie\CookieJar
9
  {
10
  /** @var string filename */
11
  private $filename;
 
12
  /** @var bool Control whether to persist session cookies or not. */
13
  private $storeSessionCookies;
 
14
  /**
15
  * Create a new FileCookieJar object
16
  *
@@ -20,14 +21,16 @@ class FileCookieJar extends \_PhpScoper5b6804f9734c8\GuzzleHttp\Cookie\CookieJar
20
  *
21
  * @throws \RuntimeException if the file cannot be found or created
22
  */
23
- public function __construct($cookieFile, $storeSessionCookies = \false)
24
  {
25
  $this->filename = $cookieFile;
26
  $this->storeSessionCookies = $storeSessionCookies;
27
- if (\file_exists($cookieFile)) {
 
28
  $this->load($cookieFile);
29
  }
30
  }
 
31
  /**
32
  * Saves the file when shutting down
33
  */
@@ -35,6 +38,7 @@ class FileCookieJar extends \_PhpScoper5b6804f9734c8\GuzzleHttp\Cookie\CookieJar
35
  {
36
  $this->save($this->filename);
37
  }
 
38
  /**
39
  * Saves the cookies to a file.
40
  *
@@ -46,15 +50,17 @@ class FileCookieJar extends \_PhpScoper5b6804f9734c8\GuzzleHttp\Cookie\CookieJar
46
  $json = [];
47
  foreach ($this as $cookie) {
48
  /** @var SetCookie $cookie */
49
- if (\_PhpScoper5b6804f9734c8\GuzzleHttp\Cookie\CookieJar::shouldPersist($cookie, $this->storeSessionCookies)) {
50
  $json[] = $cookie->toArray();
51
  }
52
  }
53
- $jsonStr = \_PhpScoper5b6804f9734c8\GuzzleHttp\json_encode($json);
54
- if (\false === \file_put_contents($filename, $jsonStr)) {
 
55
  throw new \RuntimeException("Unable to save file {$filename}");
56
  }
57
  }
 
58
  /**
59
  * Load cookies from a JSON formatted file.
60
  *
@@ -65,18 +71,19 @@ class FileCookieJar extends \_PhpScoper5b6804f9734c8\GuzzleHttp\Cookie\CookieJar
65
  */
66
  public function load($filename)
67
  {
68
- $json = \file_get_contents($filename);
69
- if (\false === $json) {
70
  throw new \RuntimeException("Unable to load file {$filename}");
71
  } elseif ($json === '') {
72
  return;
73
  }
74
- $data = \_PhpScoper5b6804f9734c8\GuzzleHttp\json_decode($json, \true);
75
- if (\is_array($data)) {
76
- foreach (\json_decode($json, \true) as $cookie) {
77
- $this->setCookie(new \_PhpScoper5b6804f9734c8\GuzzleHttp\Cookie\SetCookie($cookie));
 
78
  }
79
- } elseif (\strlen($data)) {
80
  throw new \RuntimeException("Invalid cookie file: {$filename}");
81
  }
82
  }
1
  <?php
2
+ namespace GuzzleHttp\Cookie;
 
3
 
4
  /**
5
  * Persists non-session cookies using a JSON formatted file
6
  */
7
+ class FileCookieJar extends CookieJar
8
  {
9
  /** @var string filename */
10
  private $filename;
11
+
12
  /** @var bool Control whether to persist session cookies or not. */
13
  private $storeSessionCookies;
14
+
15
  /**
16
  * Create a new FileCookieJar object
17
  *
21
  *
22
  * @throws \RuntimeException if the file cannot be found or created
23
  */
24
+ public function __construct($cookieFile, $storeSessionCookies = false)
25
  {
26
  $this->filename = $cookieFile;
27
  $this->storeSessionCookies = $storeSessionCookies;
28
+
29
+ if (file_exists($cookieFile)) {
30
  $this->load($cookieFile);
31
  }
32
  }
33
+
34
  /**
35
  * Saves the file when shutting down
36
  */
38
  {
39
  $this->save($this->filename);
40
  }
41
+
42
  /**
43
  * Saves the cookies to a file.
44
  *
50
  $json = [];
51
  foreach ($this as $cookie) {
52
  /** @var SetCookie $cookie */
53
+ if (CookieJar::shouldPersist($cookie, $this->storeSessionCookies)) {
54
  $json[] = $cookie->toArray();
55
  }
56
  }
57
+
58
+ $jsonStr = \GuzzleHttp\json_encode($json);
59
+ if (false === file_put_contents($filename, $jsonStr)) {
60
  throw new \RuntimeException("Unable to save file {$filename}");
61
  }
62
  }
63
+
64
  /**
65
  * Load cookies from a JSON formatted file.
66
  *
71
  */
72
  public function load($filename)
73
  {
74
+ $json = file_get_contents($filename);
75
+ if (false === $json) {
76
  throw new \RuntimeException("Unable to load file {$filename}");
77
  } elseif ($json === '') {
78
  return;
79
  }
80
+
81
+ $data = \GuzzleHttp\json_decode($json, true);
82
+ if (is_array($data)) {
83
+ foreach (json_decode($json, true) as $cookie) {
84
+ $this->setCookie(new SetCookie($cookie));
85
  }
86
+ } elseif (strlen($data)) {
87
  throw new \RuntimeException("Invalid cookie file: {$filename}");
88
  }
89
  }
includes/mollie-api-php/vendor/guzzlehttp/guzzle/src/Cookie/SessionCookieJar.php CHANGED
@@ -1,16 +1,17 @@
1
  <?php
2
-
3
- namespace _PhpScoper5b6804f9734c8\GuzzleHttp\Cookie;
4
 
5
  /**
6
  * Persists cookies in the client session
7
  */
8
- class SessionCookieJar extends \_PhpScoper5b6804f9734c8\GuzzleHttp\Cookie\CookieJar
9
  {
10
  /** @var string session key */
11
  private $sessionKey;
 
12
  /** @var bool Control whether to persist session cookies or not. */
13
  private $storeSessionCookies;
 
14
  /**
15
  * Create a new SessionCookieJar object
16
  *
@@ -19,12 +20,13 @@ class SessionCookieJar extends \_PhpScoper5b6804f9734c8\GuzzleHttp\Cookie\Cookie
19
  * @param bool $storeSessionCookies Set to true to store session cookies
20
  * in the cookie jar.
21
  */
22
- public function __construct($sessionKey, $storeSessionCookies = \false)
23
  {
24
  $this->sessionKey = $sessionKey;
25
  $this->storeSessionCookies = $storeSessionCookies;
26
  $this->load();
27
  }
 
28
  /**
29
  * Saves cookies to session when shutting down
30
  */
@@ -32,6 +34,7 @@ class SessionCookieJar extends \_PhpScoper5b6804f9734c8\GuzzleHttp\Cookie\Cookie
32
  {
33
  $this->save();
34
  }
 
35
  /**
36
  * Save cookies to the client session
37
  */
@@ -40,12 +43,14 @@ class SessionCookieJar extends \_PhpScoper5b6804f9734c8\GuzzleHttp\Cookie\Cookie
40
  $json = [];
41
  foreach ($this as $cookie) {
42
  /** @var SetCookie $cookie */
43
- if (\_PhpScoper5b6804f9734c8\GuzzleHttp\Cookie\CookieJar::shouldPersist($cookie, $this->storeSessionCookies)) {
44
  $json[] = $cookie->toArray();
45
  }
46
  }
47
- $_SESSION[$this->sessionKey] = \json_encode($json);
 
48
  }
 
49
  /**
50
  * Load the contents of the client session into the data array
51
  */
@@ -54,12 +59,12 @@ class SessionCookieJar extends \_PhpScoper5b6804f9734c8\GuzzleHttp\Cookie\Cookie
54
  if (!isset($_SESSION[$this->sessionKey])) {
55
  return;
56
  }
57
- $data = \json_decode($_SESSION[$this->sessionKey], \true);
58
- if (\is_array($data)) {
59
  foreach ($data as $cookie) {
60
- $this->setCookie(new \_PhpScoper5b6804f9734c8\GuzzleHttp\Cookie\SetCookie($cookie));
61
  }
62
- } elseif (\strlen($data)) {
63
  throw new \RuntimeException("Invalid cookie data");
64
  }
65
  }
1
  <?php
2
+ namespace GuzzleHttp\Cookie;
 
3
 
4
  /**
5
  * Persists cookies in the client session
6
  */
7
+ class SessionCookieJar extends CookieJar
8
  {
9
  /** @var string session key */
10
  private $sessionKey;
11
+
12
  /** @var bool Control whether to persist session cookies or not. */
13
  private $storeSessionCookies;
14
+
15
  /**
16
  * Create a new SessionCookieJar object
17
  *
20
  * @param bool $storeSessionCookies Set to true to store session cookies
21
  * in the cookie jar.
22
  */
23
+ public function __construct($sessionKey, $storeSessionCookies = false)
24
  {
25
  $this->sessionKey = $sessionKey;
26
  $this->storeSessionCookies = $storeSessionCookies;
27
  $this->load();
28
  }
29
+
30
  /**
31
  * Saves cookies to session when shutting down
32
  */
34
  {
35
  $this->save();
36
  }
37
+
38
  /**
39
  * Save cookies to the client session
40
  */
43
  $json = [];
44
  foreach ($this as $cookie) {
45
  /** @var SetCookie $cookie */
46
+ if (CookieJar::shouldPersist($cookie, $this->storeSessionCookies)) {
47
  $json[] = $cookie->toArray();
48
  }
49
  }
50
+
51
+ $_SESSION[$this->sessionKey] = json_encode($json);
52
  }
53
+
54
  /**
55
  * Load the contents of the client session into the data array
56
  */
59
  if (!isset($_SESSION[$this->sessionKey])) {
60
  return;
61
  }
62
+ $data = json_decode($_SESSION[$this->sessionKey], true);
63
+ if (is_array($data)) {
64
  foreach ($data as $cookie) {
65
+ $this->setCookie(new SetCookie($cookie));
66
  }
67
+ } elseif (strlen($data)) {
68
  throw new \RuntimeException("Invalid cookie data");
69
  }
70
  }
includes/mollie-api-php/vendor/guzzlehttp/guzzle/src/Cookie/SetCookie.php CHANGED
@@ -1,6 +1,5 @@
1
  <?php
2
-
3
- namespace _PhpScoper5b6804f9734c8\GuzzleHttp\Cookie;
4
 
5
  /**
6
  * Set-Cookie object
@@ -8,9 +7,21 @@ namespace _PhpScoper5b6804f9734c8\GuzzleHttp\Cookie;
8
  class SetCookie
9
  {
10
  /** @var array */
11
- private static $defaults = ['Name' => null, 'Value' => null, 'Domain' => null, 'Path' => '/', 'Max-Age' => null, 'Expires' => null, 'Secure' => \false, 'Discard' => \false, 'HttpOnly' => \false];
 
 
 
 
 
 
 
 
 
 
 
12
  /** @var array Cookie data */
13
  private $data;
 
14
  /**
15
  * Create a new SetCookie object from a string
16
  *
@@ -23,23 +34,27 @@ class SetCookie
23
  // Create the default return array
24
  $data = self::$defaults;
25
  // Explode the cookie string using a series of semicolons
26
- $pieces = \array_filter(\array_map('trim', \explode(';', $cookie)));
27
  // The name of the cookie (first kvp) must exist and include an equal sign.
28
- if (empty($pieces[0]) || !\strpos($pieces[0], '=')) {
29
  return new self($data);
30
  }
 
31
  // Add the cookie pieces into the parsed data array
32
  foreach ($pieces as $part) {
33
- $cookieParts = \explode('=', $part, 2);
34
- $key = \trim($cookieParts[0]);
35
- $value = isset($cookieParts[1]) ? \trim($cookieParts[1], " \n\r\t\0\v") : \true;
 
 
 
36
  // Only check for non-cookies when cookies have been found
37
  if (empty($data['Name'])) {
38
  $data['Name'] = $key;
39
  $data['Value'] = $value;
40
  } else {
41
- foreach (\array_keys(self::$defaults) as $search) {
42
- if (!\strcasecmp($search, $key)) {
43
  $data[$search] = $value;
44
  continue 2;
45
  }
@@ -47,40 +62,46 @@ class SetCookie
47
  $data[$key] = $value;
48
  }
49
  }
 
50
  return new self($data);
51
  }
 
52
  /**
53
  * @param array $data Array of cookie data provided by a Cookie parser
54
  */
55
  public function __construct(array $data = [])
56
  {
57
- $this->data = \array_replace(self::$defaults, $data);
58
  // Extract the Expires value and turn it into a UNIX timestamp if needed
59
  if (!$this->getExpires() && $this->getMaxAge()) {
60
  // Calculate the Expires date
61
- $this->setExpires(\time() + $this->getMaxAge());
62
- } elseif ($this->getExpires() && !\is_numeric($this->getExpires())) {
63
  $this->setExpires($this->getExpires());
64
  }
65
  }
 
66
  public function __toString()
67
  {
68
  $str = $this->data['Name'] . '=' . $this->data['Value'] . '; ';
69
  foreach ($this->data as $k => $v) {
70
- if ($k !== 'Name' && $k !== 'Value' && $v !== null && $v !== \false) {
71
  if ($k === 'Expires') {
72
- $str .= 'Expires=' . \gmdate('_PhpScoper5b6804f9734c8\\D, d M Y H:i:s \\G\\M\\T', $v) . '; ';
73
  } else {
74
- $str .= ($v === \true ? $k : "{$k}={$v}") . '; ';
75
  }
76
  }
77
  }
78
- return \rtrim($str, '; ');
 
79
  }
 
80
  public function toArray()
81
  {
82
  return $this->data;
83
  }
 
84
  /**
85
  * Get the cookie name
86
  *
@@ -90,6 +111,7 @@ class SetCookie
90
  {
91
  return $this->data['Name'];
92
  }
 
93
  /**
94
  * Set the cookie name
95
  *
@@ -99,6 +121,7 @@ class SetCookie
99
  {
100
  $this->data['Name'] = $name;
101
  }
 
102
  /**
103
  * Get the cookie value
104
  *
@@ -108,6 +131,7 @@ class SetCookie
108
  {
109
  return $this->data['Value'];
110
  }
 
111
  /**
112
  * Set the cookie value
113
  *
@@ -117,6 +141,7 @@ class SetCookie
117
  {
118
  $this->data['Value'] = $value;
119
  }
 
120
  /**
121
  * Get the domain
122
  *
@@ -126,6 +151,7 @@ class SetCookie
126
  {
127
  return $this->data['Domain'];
128
  }
 
129
  /**
130
  * Set the domain of the cookie
131
  *
@@ -135,6 +161,7 @@ class SetCookie
135
  {
136
  $this->data['Domain'] = $domain;
137
  }
 
138
  /**
139
  * Get the path
140
  *
@@ -144,6 +171,7 @@ class SetCookie
144
  {
145
  return $this->data['Path'];
146
  }
 
147
  /**
148
  * Set the path of the cookie
149
  *
@@ -153,6 +181,7 @@ class SetCookie
153
  {
154
  $this->data['Path'] = $path;
155
  }
 
156
  /**
157
  * Maximum lifetime of the cookie in seconds
158
  *
@@ -162,6 +191,7 @@ class SetCookie
162
  {
163
  return $this->data['Max-Age'];
164
  }
 
165
  /**
166
  * Set the max-age of the cookie
167
  *
@@ -171,6 +201,7 @@ class SetCookie
171
  {
172
  $this->data['Max-Age'] = $maxAge;
173
  }
 
174
  /**
175
  * The UNIX timestamp when the cookie Expires
176
  *
@@ -180,6 +211,7 @@ class SetCookie
180
  {
181
  return $this->data['Expires'];
182
  }
 
183
  /**
184
  * Set the unix timestamp for which the cookie will expire
185
  *
@@ -187,8 +219,11 @@ class SetCookie
187
  */
188
  public function setExpires($timestamp)
189
  {
190
- $this->data['Expires'] = \is_numeric($timestamp) ? (int) $timestamp : \strtotime($timestamp);
 
 
191
  }
 
192
  /**
193
  * Get whether or not this is a secure cookie
194
  *
@@ -198,6 +233,7 @@ class SetCookie
198
  {
199
  return $this->data['Secure'];
200
  }
 
201
  /**
202
  * Set whether or not the cookie is secure
203
  *
@@ -207,6 +243,7 @@ class SetCookie
207
  {
208
  $this->data['Secure'] = $secure;
209
  }
 
210
  /**
211
  * Get whether or not this is a session cookie
212
  *
@@ -216,6 +253,7 @@ class SetCookie
216
  {
217
  return $this->data['Discard'];
218
  }
 
219
  /**
220
  * Set whether or not this is a session cookie
221
  *
@@ -225,6 +263,7 @@ class SetCookie
225
  {
226
  $this->data['Discard'] = $discard;
227
  }
 
228
  /**
229
  * Get whether or not this is an HTTP only cookie
230
  *
@@ -234,6 +273,7 @@ class SetCookie
234
  {
235
  return $this->data['HttpOnly'];
236
  }
 
237
  /**
238
  * Set whether or not this is an HTTP only cookie
239
  *
@@ -243,6 +283,7 @@ class SetCookie
243
  {
244
  $this->data['HttpOnly'] = $httpOnly;
245
  }
 
246
  /**
247
  * Check if the cookie matches a path value.
248
  *
@@ -263,21 +304,26 @@ class SetCookie
263
  public function matchesPath($requestPath)
264
  {
265
  $cookiePath = $this->getPath();
 
266
  // Match on exact matches or when path is the default empty "/"
267
  if ($cookiePath === '/' || $cookiePath == $requestPath) {
268
- return \true;
269
  }
 
270
  // Ensure that the cookie-path is a prefix of the request path.
271
- if (0 !== \strpos($requestPath, $cookiePath)) {
272
- return \false;
273
  }
 
274
  // Match if the last character of the cookie-path is "/"
275
- if (\substr($cookiePath, -1, 1) === '/') {
276
- return \true;
277
  }
 
278
  // Match if the first character not included in cookie path is "/"
279
- return \substr($requestPath, \strlen($cookiePath), 1) === '/';
280
  }
 
281
  /**
282
  * Check if the cookie matches a domain value
283
  *
@@ -289,18 +335,22 @@ class SetCookie
289
  {
290
  // Remove the leading '.' as per spec in RFC 6265.
291
  // http://tools.ietf.org/html/rfc6265#section-5.2.3
292
- $cookieDomain = \ltrim($this->getDomain(), '.');
 
293
  // Domain not set or exact match.
294
- if (!$cookieDomain || !\strcasecmp($domain, $cookieDomain)) {
295
- return \true;
296
  }
 
297
  // Matching the subdomain according to RFC 6265.
298
  // http://tools.ietf.org/html/rfc6265#section-5.1.3
299
- if (\filter_var($domain, \FILTER_VALIDATE_IP)) {
300
- return \false;
301
  }
302
- return (bool) \preg_match('/\\.' . \preg_quote($cookieDomain, '/') . '$/', $domain);
 
303
  }
 
304
  /**
305
  * Check if the cookie is expired
306
  *
@@ -308,8 +358,9 @@ class SetCookie
308
  */
309
  public function isExpired()
310
  {
311
- return $this->getExpires() !== null && \time() > $this->getExpires();
312
  }
 
313
  /**
314
  * Check if the cookie is valid according to RFC 6265
315
  *
@@ -319,25 +370,34 @@ class SetCookie
319
  {
320
  // Names must not be empty, but can be 0
321
  $name = $this->getName();
322
- if (empty($name) && !\is_numeric($name)) {
323
  return 'The cookie name must not be empty';
324
  }
 
325
  // Check if any of the invalid characters are present in the cookie name
326
- if (\preg_match('/[\\x00-\\x20\\x22\\x28-\\x29\\x2c\\x2f\\x3a-\\x40\\x5c\\x7b\\x7d\\x7f]/', $name)) {
327
- return 'Cookie name must not contain invalid characters: ASCII ' . 'Control characters (0-31;127), space, tab and the ' . 'following characters: ()<>@,;:\\"/?={}';
 
 
 
 
 
328
  }
 
329
  // Value must not be empty, but can be 0
330
  $value = $this->getValue();
331
- if (empty($value) && !\is_numeric($value)) {
332
  return 'The cookie value must not be empty';
333
  }
 
334
  // Domains must not be empty, but can be 0
335
  // A "0" is not a valid internet domain, but may be used as server name
336
  // in a private network.
337
  $domain = $this->getDomain();
338
- if (empty($domain) && !\is_numeric($domain)) {
339
  return 'The cookie domain must not be empty';
340
  }
341
- return \true;
 
342
  }
343
  }
1
  <?php
2
+ namespace GuzzleHttp\Cookie;
 
3
 
4
  /**
5
  * Set-Cookie object
7
  class SetCookie
8
  {
9
  /** @var array */
10
+ private static $defaults = [
11
+ 'Name' => null,
12
+ 'Value' => null,
13
+ 'Domain' => null,
14
+ 'Path' => '/',
15
+ 'Max-Age' => null,
16
+ 'Expires' => null,
17
+ 'Secure' => false,
18
+ 'Discard' => false,
19
+ 'HttpOnly' => false
20
+ ];
21
+
22
  /** @var array Cookie data */
23
  private $data;
24
+
25
  /**
26
  * Create a new SetCookie object from a string
27
  *
34
  // Create the default return array
35
  $data = self::$defaults;
36
  // Explode the cookie string using a series of semicolons
37
+ $pieces = array_filter(array_map('trim', explode(';', $cookie)));
38
  // The name of the cookie (first kvp) must exist and include an equal sign.
39
+ if (empty($pieces[0]) || !strpos($pieces[0], '=')) {
40
  return new self($data);
41
  }
42
+
43
  // Add the cookie pieces into the parsed data array
44
  foreach ($pieces as $part) {
45
+ $cookieParts = explode('=', $part, 2);
46
+ $key = trim($cookieParts[0]);
47
+ $value = isset($cookieParts[1])
48
+ ? trim($cookieParts[1], " \n\r\t\0\x0B")
49
+ : true;
50
+
51
  // Only check for non-cookies when cookies have been found
52
  if (empty($data['Name'])) {
53
  $data['Name'] = $key;
54
  $data['Value'] = $value;
55
  } else {
56
+ foreach (array_keys(self::$defaults) as $search) {
57
+ if (!strcasecmp($search, $key)) {
58
  $data[$search] = $value;
59
  continue 2;
60
  }
62
  $data[$key] = $value;
63
  }
64
  }
65
+
66
  return new self($data);
67
  }
68
+
69
  /**
70
  * @param array $data Array of cookie data provided by a Cookie parser
71
  */
72
  public function __construct(array $data = [])
73
  {
74
+ $this->data = array_replace(self::$defaults, $data);
75
  // Extract the Expires value and turn it into a UNIX timestamp if needed
76
  if (!$this->getExpires() && $this->getMaxAge()) {
77
  // Calculate the Expires date
78
+ $this->setExpires(time() + $this->getMaxAge());
79
+ } elseif ($this->getExpires() && !is_numeric($this->getExpires())) {
80
  $this->setExpires($this->getExpires());
81
  }
82
  }
83
+
84
  public function __toString()
85
  {
86
  $str = $this->data['Name'] . '=' . $this->data['Value'] . '; ';
87
  foreach ($this->data as $k => $v) {
88
+ if ($k !== 'Name' && $k !== 'Value' && $v !== null && $v !== false) {
89
  if ($k === 'Expires') {
90
+ $str .= 'Expires=' . gmdate('D, d M Y H:i:s \G\M\T', $v) . '; ';
91
  } else {
92
+ $str .= ($v === true ? $k : "{$k}={$v}") . '; ';
93
  }
94
  }
95
  }
96
+
97
+ return rtrim($str, '; ');
98
  }
99
+
100
  public function toArray()
101
  {
102
  return $this->data;
103
  }
104
+
105
  /**
106
  * Get the cookie name
107
  *
111
  {
112
  return $this->data['Name'];
113
  }
114
+
115
  /**
116
  * Set the cookie name
117
  *
121
  {
122
  $this->data['Name'] = $name;
123
  }
124
+
125
  /**
126
  * Get the cookie value
127
  *
131
  {
132
  return $this->data['Value'];
133
  }
134
+
135
  /**
136
  * Set the cookie value
137
  *
141
  {
142
  $this->data['Value'] = $value;
143
  }
144
+
145
  /**
146
  * Get the domain
147
  *
151
  {
152
  return $this->data['Domain'];
153
  }
154
+
155
  /**
156
  * Set the domain of the cookie
157
  *
161
  {
162
  $this->data['Domain'] = $domain;
163
  }
164
+
165
  /**
166
  * Get the path
167
  *
171
  {
172
  return $this->data['Path'];
173
  }
174
+
175
  /**
176
  * Set the path of the cookie
177
  *
181
  {
182
  $this->data['Path'] = $path;
183
  }
184
+
185
  /**
186
  * Maximum lifetime of the cookie in seconds
187
  *
191
  {
192
  return $this->data['Max-Age'];
193
  }
194
+
195
  /**
196
  * Set the max-age of the cookie
197
  *
201
  {
202
  $this->data['Max-Age'] = $maxAge;
203
  }
204
+
205
  /**
206
  * The UNIX timestamp when the cookie Expires
207
  *
211
  {
212
  return $this->data['Expires'];
213
  }
214
+
215
  /**
216
  * Set the unix timestamp for which the cookie will expire
217
  *
219
  */
220
  public function setExpires($timestamp)
221
  {
222
+ $this->data['Expires'] = is_numeric($timestamp)
223
+ ? (int) $timestamp
224
+ : strtotime($timestamp);
225
  }
226
+
227
  /**
228
  * Get whether or not this is a secure cookie
229
  *
233
  {
234
  return $this->data['Secure'];
235
  }
236
+
237
  /**
238
  * Set whether or not the cookie is secure
239
  *
243
  {
244
  $this->data['Secure'] = $secure;
245
  }
246
+
247
  /**
248
  * Get whether or not this is a session cookie
249
  *
253
  {
254
  return $this->data['Discard'];
255
  }
256
+
257
  /**
258
  * Set whether or not this is a session cookie
259
  *
263
  {
264
  $this->data['Discard'] = $discard;
265
  }
266
+
267
  /**
268
  * Get whether or not this is an HTTP only cookie
269
  *
273
  {
274
  return $this->data['HttpOnly'];
275
  }
276
+
277
  /**
278
  * Set whether or not this is an HTTP only cookie
279
  *
283
  {
284
  $this->data['HttpOnly'] = $httpOnly;
285
  }
286
+
287
  /**
288
  * Check if the cookie matches a path value.
289
  *
304
  public function matchesPath($requestPath)
305
  {
306
  $cookiePath = $this->getPath();
307
+
308
  // Match on exact matches or when path is the default empty "/"
309
  if ($cookiePath === '/' || $cookiePath == $requestPath) {
310
+ return true;
311
  }
312
+
313
  // Ensure that the cookie-path is a prefix of the request path.
314
+ if (0 !== strpos($requestPath, $cookiePath)) {
315
+ return false;
316
  }
317
+
318
  // Match if the last character of the cookie-path is "/"
319
+ if (substr($cookiePath, -1, 1) === '/') {
320
+ return true;
321
  }
322
+
323
  // Match if the first character not included in cookie path is "/"
324
+ return substr($requestPath, strlen($cookiePath), 1) === '/';
325
  }
326
+
327
  /**
328
  * Check if the cookie matches a domain value
329
  *
335
  {
336
  // Remove the leading '.' as per spec in RFC 6265.
337
  // http://tools.ietf.org/html/rfc6265#section-5.2.3
338
+ $cookieDomain = ltrim($this->getDomain(), '.');
339
+
340
  // Domain not set or exact match.
341
+ if (!$cookieDomain || !strcasecmp($domain, $cookieDomain)) {
342
+ return true;
343
  }
344
+
345
  // Matching the subdomain according to RFC 6265.
346
  // http://tools.ietf.org/html/rfc6265#section-5.1.3
347
+ if (filter_var($domain, FILTER_VALIDATE_IP)) {
348
+ return false;
349
  }
350
+
351
+ return (bool) preg_match('/\.' . preg_quote($cookieDomain, '/') . '$/', $domain);
352
  }
353
+
354
  /**
355
  * Check if the cookie is expired
356
  *
358
  */
359
  public function isExpired()
360
  {
361
+ return $this->getExpires() !== null && time() > $this->getExpires();
362
  }
363
+
364
  /**
365
  * Check if the cookie is valid according to RFC 6265
366
  *
370
  {
371
  // Names must not be empty, but can be 0
372
  $name = $this->getName();
373
+ if (empty($name) && !is_numeric($name)) {
374
  return 'The cookie name must not be empty';
375
  }
376
+
377
  // Check if any of the invalid characters are present in the cookie name
378
+ if (preg_match(
379
+ '/[\x00-\x20\x22\x28-\x29\x2c\x2f\x3a-\x40\x5c\x7b\x7d\x7f]/',
380
+ $name
381
+ )) {
382
+ return 'Cookie name must not contain invalid characters: ASCII '
383
+ . 'Control characters (0-31;127), space, tab and the '
384
+ . 'following characters: ()<>@,;:\"/?={}';
385
  }
386
+
387
  // Value must not be empty, but can be 0
388
  $value = $this->getValue();
389
+ if (empty($value) && !is_numeric($value)) {
390
  return 'The cookie value must not be empty';
391
  }
392
+
393
  // Domains must not be empty, but can be 0
394
  // A "0" is not a valid internet domain, but may be used as server name
395
  // in a private network.
396
  $domain = $this->getDomain();
397
+ if (empty($domain) && !is_numeric($domain)) {
398
  return 'The cookie domain must not be empty';
399
  }
400
+
401
+ return true;
402
  }
403
  }
includes/mollie-api-php/vendor/guzzlehttp/guzzle/src/Exception/BadResponseException.php CHANGED
@@ -1,18 +1,26 @@
1
  <?php
 
2
 
3
- namespace _PhpScoper5b6804f9734c8\GuzzleHttp\Exception;
 
4
 
5
- use _PhpScoper5b6804f9734c8\Psr\Http\Message\RequestInterface;
6
- use _PhpScoper5b6804f9734c8\Psr\Http\Message\ResponseInterface;
7
  /**
8
  * Exception when an HTTP error occurs (4xx or 5xx error)
9
  */
10
- class BadResponseException extends \_PhpScoper5b6804f9734c8\GuzzleHttp\Exception\RequestException
11
  {
12
- public function __construct($message, \_PhpScoper5b6804f9734c8\Psr\Http\Message\RequestInterface $request, \_PhpScoper5b6804f9734c8\Psr\Http\Message\ResponseInterface $response = null, \Exception $previous = null, array $handlerContext = [])
13
- {
 
 
 
 
 
14
  if (null === $response) {
15
- @\trigger_error('Instantiating the ' . __CLASS__ . ' class without a Response is deprecated since version 6.3 and will be removed in 7.0.', \E_USER_DEPRECATED);
 
 
 
16
  }
17
  parent::__construct($message, $request, $response, $previous, $handlerContext);
18
  }
1
  <?php
2
+ namespace GuzzleHttp\Exception;
3
 
4
+ use Psr\Http\Message\RequestInterface;
5
+ use Psr\Http\Message\ResponseInterface;
6
 
 
 
7
  /**
8
  * Exception when an HTTP error occurs (4xx or 5xx error)
9
  */
10
+ class BadResponseException extends RequestException
11
  {
12
+ public function __construct(
13
+ $message,
14
+ RequestInterface $request,
15
+ ResponseInterface $response = null,
16
+ \Exception $previous = null,
17
+ array $handlerContext = []
18
+ ) {
19
  if (null === $response) {
20
+ @trigger_error(
21
+ 'Instantiating the ' . __CLASS__ . ' class without a Response is deprecated since version 6.3 and will be removed in 7.0.',
22
+ E_USER_DEPRECATED
23
+ );
24
  }
25
  parent::__construct($message, $request, $response, $previous, $handlerContext);
26
  }
includes/mollie-api-php/vendor/guzzlehttp/guzzle/src/Exception/ClientException.php CHANGED
@@ -1,10 +1,7 @@
1
  <?php
2
-
3
- namespace _PhpScoper5b6804f9734c8\GuzzleHttp\Exception;
4
 
5
  /**
6
  * Exception when a client error is encountered (4xx codes)
7
  */
8
- class ClientException extends \_PhpScoper5b6804f9734c8\GuzzleHttp\Exception\BadResponseException
9
- {
10
- }
1
  <?php
2
+ namespace GuzzleHttp\Exception;
 
3
 
4
  /**
5
  * Exception when a client error is encountered (4xx codes)
6
  */
7
+ class ClientException extends BadResponseException {}
 
 
includes/mollie-api-php/vendor/guzzlehttp/guzzle/src/Exception/ConnectException.php CHANGED
@@ -1,19 +1,24 @@
1
  <?php
 
2
 
3
- namespace _PhpScoper5b6804f9734c8\GuzzleHttp\Exception;
4
 
5
- use _PhpScoper5b6804f9734c8\Psr\Http\Message\RequestInterface;
6
  /**
7
  * Exception thrown when a connection cannot be established.
8
  *
9
  * Note that no response is present for a ConnectException
10
  */
11
- class ConnectException extends \_PhpScoper5b6804f9734c8\GuzzleHttp\Exception\RequestException
12
  {
13
- public function __construct($message, \_PhpScoper5b6804f9734c8\Psr\Http\Message\RequestInterface $request, \Exception $previous = null, array $handlerContext = [])
14
- {
 
 
 
 
15
  parent::__construct($message, $request, null, $previous, $handlerContext);
16
  }
 
17
  /**
18
  * @return null
19
  */
@@ -21,11 +26,12 @@ class ConnectException extends \_PhpScoper5b6804f9734c8\GuzzleHttp\Exception\Req
21
  {
22
  return null;
23
  }
 
24
  /**
25
  * @return bool
26
  */
27
  public function hasResponse()
28
  {
29
- return \false;
30
  }
31
  }
1
  <?php
2
+ namespace GuzzleHttp\Exception;
3
 
4
+ use Psr\Http\Message\RequestInterface;
5
 
 
6
  /**
7
  * Exception thrown when a connection cannot be established.
8
  *
9
  * Note that no response is present for a ConnectException
10
  */
11
+ class ConnectException extends RequestException
12
  {
13
+ public function __construct(
14
+ $message,
15
+ RequestInterface $request,
16
+ \Exception $previous = null,
17
+ array $handlerContext = []
18
+ ) {
19
  parent::__construct($message, $request, null, $previous, $handlerContext);
20
  }
21
+
22
  /**
23
  * @return null
24
  */
26
  {
27
  return null;
28
  }
29
+
30
  /**
31
  * @return bool
32
  */
33
  public function hasResponse()
34
  {
35
+ return false;
36
  }
37
  }
includes/mollie-api-php/vendor/guzzlehttp/guzzle/src/Exception/GuzzleException.php CHANGED
@@ -1,6 +1,5 @@
1
  <?php
2
-
3
- namespace _PhpScoper5b6804f9734c8\GuzzleHttp\Exception;
4
 
5
  /**
6
  * @method string getMessage()
@@ -11,6 +10,4 @@ namespace _PhpScoper5b6804f9734c8\GuzzleHttp\Exception;
11
  * @method array getTrace()
12
  * @method string getTraceAsString()
13
  */
14
- interface GuzzleException
15
- {
16
- }
1
  <?php
2
+ namespace GuzzleHttp\Exception;
 
3
 
4
  /**
5
  * @method string getMessage()
10
  * @method array getTrace()
11
  * @method string getTraceAsString()
12
  */
13
+ interface GuzzleException {}
 
 
includes/mollie-api-php/vendor/guzzlehttp/guzzle/src/Exception/RequestException.php CHANGED
@@ -1,31 +1,42 @@
1
  <?php
 
2
 
3
- namespace _PhpScoper5b6804f9734c8\GuzzleHttp\Exception;
 
 
 
4
 
5
- use _PhpScoper5b6804f9734c8\Psr\Http\Message\RequestInterface;
6
- use _PhpScoper5b6804f9734c8\Psr\Http\Message\ResponseInterface;
7
- use _PhpScoper5b6804f9734c8\GuzzleHttp\Promise\PromiseInterface;
8
- use _PhpScoper5b6804f9734c8\Psr\Http\Message\UriInterface;
9
  /**
10
  * HTTP Request exception
11
  */
12
- class RequestException extends \_PhpScoper5b6804f9734c8\GuzzleHttp\Exception\TransferException
13
  {
14
  /** @var RequestInterface */
15
  private $request;
 
16
  /** @var ResponseInterface */
17
  private $response;
 
18
  /** @var array */
19
  private $handlerContext;
20
- public function __construct($message, \_PhpScoper5b6804f9734c8\Psr\Http\Message\RequestInterface $request, \_PhpScoper5b6804f9734c8\Psr\Http\Message\ResponseInterface $response = null, \Exception $previous = null, array $handlerContext = [])
21
- {
 
 
 
 
 
 
22
  // Set the code of the exception if the response is set and not future.
23
- $code = $response && !$response instanceof \_PhpScoper5b6804f9734c8\GuzzleHttp\Promise\PromiseInterface ? $response->getStatusCode() : 0;
 
 
24
  parent::__construct($message, $code, $previous);
25
  $this->request = $request;
26
  $this->response = $response;
27
  $this->handlerContext = $handlerContext;
28
  }
 
29
  /**
30
  * Wrap non-RequestExceptions with a RequestException
31
  *
@@ -34,10 +45,13 @@ class RequestException extends \_PhpScoper5b6804f9734c8\GuzzleHttp\Exception\Tra
34
  *
35
  * @return RequestException
36
  */
37
- public static function wrapException(\_PhpScoper5b6804f9734c8\Psr\Http\Message\RequestInterface $request, \Exception $e)
38
  {
39
- return $e instanceof \_PhpScoper5b6804f9734c8\GuzzleHttp\Exception\RequestException ? $e : new \_PhpScoper5b6804f9734c8\GuzzleHttp\Exception\RequestException($e->getMessage(), $request, null, $e);
 
 
40
  }
 
41
  /**
42
  * Factory method to create a new exception with a normalized error message
43
  *
@@ -48,33 +62,57 @@ class RequestException extends \_PhpScoper5b6804f9734c8\GuzzleHttp\Exception\Tra
48
  *
49
  * @return self
50
  */
51
- public static function create(\_PhpScoper5b6804f9734c8\Psr\Http\Message\RequestInterface $request, \_PhpScoper5b6804f9734c8\Psr\Http\Message\ResponseInterface $response = null, \Exception $previous = null, array $ctx = [])
52
- {
 
 
 
 
53
  if (!$response) {
54
- return new self('Error completing request', $request, null, $previous, $ctx);
 
 
 
 
 
 
55
  }
56
- $level = (int) \floor($response->getStatusCode() / 100);
 
57
  if ($level === 4) {
58
  $label = 'Client error';
59
- $className = \_PhpScoper5b6804f9734c8\GuzzleHttp\Exception\ClientException::class;
60
  } elseif ($level === 5) {
61
  $label = 'Server error';
62
- $className = \_PhpScoper5b6804f9734c8\GuzzleHttp\Exception\ServerException::class;
63
  } else {
64
  $label = 'Unsuccessful request';
65
  $className = __CLASS__;
66
  }
 
67
  $uri = $request->getUri();
68
  $uri = static::obfuscateUri($uri);
 
69
  // Client Error: `GET /` resulted in a `404 Not Found` response:
70
  // <html> ... (truncated)
71
- $message = \sprintf('%s: `%s %s` resulted in a `%s %s` response', $label, $request->getMethod(), $uri, $response->getStatusCode(), $response->getReasonPhrase());
 
 
 
 
 
 
 
 
72
  $summary = static::getResponseBodySummary($response);
 
73
  if ($summary !== null) {
74
  $message .= ":\n{$summary}\n";
75
  }
 
76
  return new $className($message, $request, $response, $previous, $ctx);
77
  }
 
78
  /**
79
  * Get a short summary of the response
80
  *
@@ -84,28 +122,36 @@ class RequestException extends \_PhpScoper5b6804f9734c8\GuzzleHttp\Exception\Tra
84
  *
85
  * @return string|null
86
  */
87
- public static function getResponseBodySummary(\_PhpScoper5b6804f9734c8\Psr\Http\Message\ResponseInterface $response)
88
  {
89
  $body = $response->getBody();
 
90
  if (!$body->isSeekable()) {
91
  return null;
92
  }
 
93
  $size = $body->getSize();
 
94
  if ($size === 0) {
95
  return null;
96
  }
 
97
  $summary = $body->read(120);
98
  $body->rewind();
 
99
  if ($size > 120) {
100
  $summary .= ' (truncated...)';
101
  }
 
102
  // Matches any printable character, including unicode characters:
103
  // letters, marks, numbers, punctuation, spacing, and separators.
104
- if (\preg_match('/[^\\pL\\pM\\pN\\pP\\pS\\pZ\\n\\r\\t]/', $summary)) {
105
  return null;
106
  }
 
107
  return $summary;
108
  }
 
109
  /**
110
  * Obfuscates URI if there is an username and a password present
111
  *
@@ -116,11 +162,14 @@ class RequestException extends \_PhpScoper5b6804f9734c8\GuzzleHttp\Exception\Tra
116
  private static function obfuscateUri($uri)
117
  {
118
  $userInfo = $uri->getUserInfo();
119
- if (\false !== ($pos = \strpos($userInfo, ':'))) {
120
- return $uri->withUserInfo(\substr($userInfo, 0, $pos), '***');
 
121
  }
 
122
  return $uri;
123
  }
 
124
  /**
125
  * Get the request that caused the exception
126
  *
@@ -130,6 +179,7 @@ class RequestException extends \_PhpScoper5b6804f9734c8\GuzzleHttp\Exception\Tra
130
  {
131
  return $this->request;
132
  }
 
133
  /**
134
  * Get the associated response
135
  *
@@ -139,6 +189,7 @@ class RequestException extends \_PhpScoper5b6804f9734c8\GuzzleHttp\Exception\Tra
139
  {
140
  return $this->response;
141
  }
 
142
  /**
143
  * Check if a response was received
144
  *
@@ -148,6 +199,7 @@ class RequestException extends \_PhpScoper5b6804f9734c8\GuzzleHttp\Exception\Tra
148
  {
149
  return $this->response !== null;
150
  }
 
151
  /**
152
  * Get contextual information about the error from the underlying handler.
153
  *
1
  <?php
2
+ namespace GuzzleHttp\Exception;
3
 
4
+ use Psr\Http\Message\RequestInterface;
5
+ use Psr\Http\Message\ResponseInterface;
6
+ use GuzzleHttp\Promise\PromiseInterface;
7
+ use Psr\Http\Message\UriInterface;
8
 
 
 
 
 
9
  /**
10
  * HTTP Request exception
11
  */
12
+ class RequestException extends TransferException
13
  {
14
  /** @var RequestInterface */
15
  private $request;
16
+
17
  /** @var ResponseInterface */
18
  private $response;
19
+
20
  /** @var array */
21
  private $handlerContext;
22
+
23
+ public function __construct(
24
+ $message,
25
+ RequestInterface $request,
26
+ ResponseInterface $response = null,
27
+ \Exception $previous = null,
28
+ array $handlerContext = []
29
+ ) {
30
  // Set the code of the exception if the response is set and not future.
31
+ $code = $response && !($response instanceof PromiseInterface)
32
+ ? $response->getStatusCode()
33
+ : 0;
34
  parent::__construct($message, $code, $previous);
35
  $this->request = $request;
36
  $this->response = $response;
37
  $this->handlerContext = $handlerContext;
38
  }
39
+
40
  /**
41
  * Wrap non-RequestExceptions with a RequestException
42
  *
45
  *
46
  * @return RequestException
47
  */
48
+ public static function wrapException(RequestInterface $request, \Exception $e)
49
  {
50
+ return $e instanceof RequestException
51
+ ? $e
52
+ : new RequestException($e->getMessage(), $request, null, $e);
53
  }
54
+
55
  /**
56
  * Factory method to create a new exception with a normalized error message
57
  *
62
  *
63
  * @return self
64
  */
65
+ public static function create(
66
+ RequestInterface $request,
67
+ ResponseInterface $response = null,
68
+ \Exception $previous = null,
69
+ array $ctx = []
70
+ ) {
71
  if (!$response) {
72
+ return new self(
73
+ 'Error completing request',
74
+ $request,
75
+ null,
76
+ $previous,
77
+ $ctx
78
+ );
79
  }
80
+
81
+ $level = (int) floor($response->getStatusCode() / 100);
82
  if ($level === 4) {
83
  $label = 'Client error';
84
+ $className = ClientException::class;
85
  } elseif ($level === 5) {
86
  $label = 'Server error';
87
+ $className = ServerException::class;
88
  } else {
89
  $label = 'Unsuccessful request';
90
  $className = __CLASS__;
91
  }
92
+
93
  $uri = $request->getUri();
94
  $uri = static::obfuscateUri($uri);
95
+
96
  // Client Error: `GET /` resulted in a `404 Not Found` response:
97
  // <html> ... (truncated)
98
+ $message = sprintf(
99
+ '%s: `%s %s` resulted in a `%s %s` response',
100
+ $label,
101
+ $request->getMethod(),
102
+ $uri,
103
+ $response->getStatusCode(),
104
+ $response->getReasonPhrase()
105
+ );
106
+
107
  $summary = static::getResponseBodySummary($response);
108
+
109
  if ($summary !== null) {
110
  $message .= ":\n{$summary}\n";
111
  }
112
+
113
  return new $className($message, $request, $response, $previous, $ctx);
114
  }
115
+
116
  /**
117
  * Get a short summary of the response
118
  *
122
  *
123
  * @return string|null
124
  */
125
+ public static function getResponseBodySummary(ResponseInterface $response)
126
  {
127
  $body = $response->getBody();
128
+
129
  if (!$body->isSeekable()) {
130
  return null;
131
  }
132
+
133
  $size = $body->getSize();
134
+
135
  if ($size === 0) {
136
  return null;
137
  }
138
+
139
  $summary = $body->read(120);
140
  $body->rewind();
141
+
142
  if ($size > 120) {
143
  $summary .= ' (truncated...)';
144
  }
145
+
146
  // Matches any printable character, including unicode characters:
147
  // letters, marks, numbers, punctuation, spacing, and separators.
148
+ if (preg_match('/[^\pL\pM\pN\pP\pS\pZ\n\r\t]/', $summary)) {
149
  return null;
150
  }
151
+
152
  return $summary;
153
  }
154
+
155
  /**
156
  * Obfuscates URI if there is an username and a password present
157
  *
162
  private static function obfuscateUri($uri)
163
  {
164
  $userInfo = $uri->getUserInfo();
165
+
166
+ if (false !== ($pos = strpos($userInfo, ':'))) {
167
+ return $uri->withUserInfo(substr($userInfo, 0, $pos), '***');
168
  }
169
+
170
  return $uri;
171
  }
172
+
173
  /**
174
  * Get the request that caused the exception
175
  *
179
  {
180
  return $this->request;
181
  }
182
+
183
  /**
184
  * Get the associated response
185
  *
189
  {
190
  return $this->response;
191
  }
192
+
193
  /**
194
  * Check if a response was received
195
  *
199
  {
200
  return $this->response !== null;
201
  }
202
+
203
  /**
204
  * Get contextual information about the error from the underlying handler.
205
  *
includes/mollie-api-php/vendor/guzzlehttp/guzzle/src/Exception/SeekException.php CHANGED
@@ -1,20 +1,22 @@
1
  <?php
 
2
 
3
- namespace _PhpScoper5b6804f9734c8\GuzzleHttp\Exception;
4
 
5
- use _PhpScoper5b6804f9734c8\Psr\Http\Message\StreamInterface;
6
  /**
7
  * Exception thrown when a seek fails on a stream.
8
  */
9
- class SeekException extends \RuntimeException implements \_PhpScoper5b6804f9734c8\GuzzleHttp\Exception\GuzzleException
10
  {
11
  private $stream;
12
- public function __construct(\_PhpScoper5b6804f9734c8\Psr\Http\Message\StreamInterface $stream, $pos = 0, $msg = '')
 
13
  {
14
  $this->stream = $stream;
15
  $msg = $msg ?: 'Could not seek the stream to position ' . $pos;
16
  parent::__construct($msg);
17
  }
 
18
  /**
19
  * @return StreamInterface
20
  */
1
  <?php
2
+ namespace GuzzleHttp\Exception;
3
 
4
+ use Psr\Http\Message\StreamInterface;
5
 
 
6
  /**
7
  * Exception thrown when a seek fails on a stream.
8
  */
9
+ class SeekException extends \RuntimeException implements GuzzleException
10
  {
11
  private $stream;
12
+
13
+ public function __construct(StreamInterface $stream, $pos = 0, $msg = '')
14
  {
15
  $this->stream = $stream;
16
  $msg = $msg ?: 'Could not seek the stream to position ' . $pos;
17
  parent::__construct($msg);
18
  }
19
+
20
  /**
21
  * @return StreamInterface
22
  */
includes/mollie-api-php/vendor/guzzlehttp/guzzle/src/Exception/ServerException.php CHANGED
@@ -1,10 +1,7 @@
1
  <?php
2
-
3
- namespace _PhpScoper5b6804f9734c8\GuzzleHttp\Exception;
4
 
5
  /**
6
  * Exception when a server error is encountered (5xx codes)
7
  */
8
- class ServerException extends \_PhpScoper5b6804f9734c8\GuzzleHttp\Exception\BadResponseException
9
- {
10
- }
1
  <?php
2
+ namespace GuzzleHttp\Exception;
 
3
 
4
  /**
5
  * Exception when a server error is encountered (5xx codes)
6
  */
7
+ class ServerException extends BadResponseException {}
 
 
includes/mollie-api-php/vendor/guzzlehttp/guzzle/src/Exception/TooManyRedirectsException.php CHANGED
@@ -1,7 +1,4 @@
1
  <?php
 
2
 
3
- namespace _PhpScoper5b6804f9734c8\GuzzleHttp\Exception;
4
-
5
- class TooManyRedirectsException extends \_PhpScoper5b6804f9734c8\GuzzleHttp\Exception\RequestException
6
- {
7
- }
1
  <?php
2
+ namespace GuzzleHttp\Exception;
3
 
4
+ class TooManyRedirectsException extends RequestException {}
 
 
 
 
includes/mollie-api-php/vendor/guzzlehttp/guzzle/src/Exception/TransferException.php CHANGED
@@ -1,7 +1,4 @@
1
  <?php
 
2
 
3
- namespace _PhpScoper5b6804f9734c8\GuzzleHttp\Exception;
4
-
5
- class TransferException extends \RuntimeException implements \_PhpScoper5b6804f9734c8\GuzzleHttp\Exception\GuzzleException
6
- {
7
- }
1
  <?php
2
+ namespace GuzzleHttp\Exception;
3
 
4
+ class TransferException extends \RuntimeException implements GuzzleException {}
 
 
 
 
includes/mollie-api-php/vendor/guzzlehttp/guzzle/src/Handler/CurlFactory.php CHANGED
@@ -1,23 +1,25 @@
1
  <?php
 
2
 
3
- namespace _PhpScoper5b6804f9734c8\GuzzleHttp\Handler;
 
 
 
 
 
 
4
 
5
- use _PhpScoper5b6804f9734c8\GuzzleHttp\Exception\RequestException;
6
- use _PhpScoper5b6804f9734c8\GuzzleHttp\Exception\ConnectException;
7
- use _PhpScoper5b6804f9734c8\GuzzleHttp\Promise\FulfilledPromise;
8
- use _PhpScoper5b6804f9734c8\GuzzleHttp\Psr7;
9
- use _PhpScoper5b6804f9734c8\GuzzleHttp\Psr7\LazyOpenStream;
10
- use _PhpScoper5b6804f9734c8\GuzzleHttp\TransferStats;
11
- use _PhpScoper5b6804f9734c8\Psr\Http\Message\RequestInterface;
12
  /**
13
  * Creates curl resources from a request
14
  */
15
- class CurlFactory implements \_PhpScoper5b6804f9734c8\GuzzleHttp\Handler\CurlFactoryInterface
16
  {
17
  /** @var array */
18
  private $handles = [];
 
19
  /** @var int Total number of idle handles to keep in cache */
20
  private $maxHandles;
 
21
  /**
22
  * @param int $maxHandles Maximum number of idle handles.
23
  */
@@ -25,13 +27,15 @@ class CurlFactory implements \_PhpScoper5b6804f9734c8\GuzzleHttp\Handler\CurlFac
25
  {
26
  $this->maxHandles = $maxHandles;
27
  }
28
- public function create(\_PhpScoper5b6804f9734c8\Psr\Http\Message\RequestInterface $request, array $options)
 
29
  {
30
  if (isset($options['curl']['body_as_string'])) {
31
  $options['_body_as_string'] = $options['curl']['body_as_string'];
32
  unset($options['curl']['body_as_string']);
33
  }
34
- $easy = new \_PhpScoper5b6804f9734c8\GuzzleHttp\Handler\EasyHandle();
 
35
  $easy->request = $request;
36
  $easy->options = $options;
37
  $conf = $this->getDefaultConf($easy);
@@ -39,34 +43,42 @@ class CurlFactory implements \_PhpScoper5b6804f9734c8\GuzzleHttp\Handler\CurlFac
39
  $this->applyHandlerOptions($easy, $conf);
40
  $this->applyHeaders($easy, $conf);
41
  unset($conf['_headers']);
 
42
  // Add handler options from the request configuration options
43
  if (isset($options['curl'])) {
44
- $conf = \array_replace($conf, $options['curl']);
45
  }
46
- $conf[\CURLOPT_HEADERFUNCTION] = $this->createHeaderFn($easy);
47
- $easy->handle = $this->handles ? \array_pop($this->handles) : \curl_init();
48
- \curl_setopt_array($easy->handle, $conf);
 
 
 
 
49
  return $easy;
50
  }
51
- public function release(\_PhpScoper5b6804f9734c8\GuzzleHttp\Handler\EasyHandle $easy)
 
52
  {
53
  $resource = $easy->handle;
54
  unset($easy->handle);
55
- if (\count($this->handles) >= $this->maxHandles) {
56
- \curl_close($resource);
 
57
  } else {
58
  // Remove all callback functions as they can hold onto references
59
  // and are not cleaned up by curl_reset. Using curl_setopt_array
60
  // does not work for some reason, so removing each one
61
  // individually.
62
- \curl_setopt($resource, \CURLOPT_HEADERFUNCTION, null);
63
- \curl_setopt($resource, \CURLOPT_READFUNCTION, null);
64
- \curl_setopt($resource, \CURLOPT_WRITEFUNCTION, null);
65
- \curl_setopt($resource, \CURLOPT_PROGRESSFUNCTION, null);
66
- \curl_reset($resource);
67
  $this->handles[] = $resource;
68
  }
69
  }
 
70
  /**
71
  * Completes a cURL transaction, either returning a response promise or a
72
  * rejected promise.
@@ -77,122 +89,201 @@ class CurlFactory implements \_PhpScoper5b6804f9734c8\GuzzleHttp\Handler\CurlFac
77
  *
78
  * @return \GuzzleHttp\Promise\PromiseInterface
79
  */
80
- public static function finish(callable $handler, \_PhpScoper5b6804f9734c8\GuzzleHttp\Handler\EasyHandle $easy, \_PhpScoper5b6804f9734c8\GuzzleHttp\Handler\CurlFactoryInterface $factory)
81
- {
 
 
 
82
  if (isset($easy->options['on_stats'])) {
83
  self::invokeStats($easy);
84
  }
 
85
  if (!$easy->response || $easy->errno) {
86
  return self::finishError($handler, $easy, $factory);
87
  }
 
88
  // Return the response if it is present and there is no error.
89
  $factory->release($easy);
 
90
  // Rewind the body of the response if possible.
91
  $body = $easy->response->getBody();
92
  if ($body->isSeekable()) {
93
  $body->rewind();
94
  }
95
- return new \_PhpScoper5b6804f9734c8\GuzzleHttp\Promise\FulfilledPromise($easy->response);
 
96
  }
97
- private static function invokeStats(\_PhpScoper5b6804f9734c8\GuzzleHttp\Handler\EasyHandle $easy)
 
98
  {
99
- $curlStats = \curl_getinfo($easy->handle);
100
- $stats = new \_PhpScoper5b6804f9734c8\GuzzleHttp\TransferStats($easy->request, $easy->response, $curlStats['total_time'], $easy->errno, $curlStats);
101
- \call_user_func($easy->options['on_stats'], $stats);
 
 
 
 
 
 
102
  }
103
- private static function finishError(callable $handler, \_PhpScoper5b6804f9734c8\GuzzleHttp\Handler\EasyHandle $easy, \_PhpScoper5b6804f9734c8\GuzzleHttp\Handler\CurlFactoryInterface $factory)
104
- {
 
 
 
 
105
  // Get error information and release the handle to the factory.
106
- $ctx = ['errno' => $easy->errno, 'error' => \curl_error($easy->handle)] + \curl_getinfo($easy->handle);
 
 
 
107
  $factory->release($easy);
 
108
  // Retry when nothing is present or when curl failed to rewind.
109
- if (empty($easy->options['_err_message']) && (!$easy->errno || $easy->errno == 65)) {
 
 
110
  return self::retryFailedRewind($handler, $easy, $ctx);
111
  }
 
112
  return self::createRejection($easy, $ctx);
113
  }
114
- private static function createRejection(\_PhpScoper5b6804f9734c8\GuzzleHttp\Handler\EasyHandle $easy, array $ctx)
 
115
  {
116
- static $connectionErrors = [\CURLE_OPERATION_TIMEOUTED => \true, \CURLE_COULDNT_RESOLVE_HOST => \true, \CURLE_COULDNT_CONNECT => \true, \CURLE_SSL_CONNECT_ERROR => \true, \CURLE_GOT_NOTHING => \true];
 
 
 
 
 
 
 
117
  // If an exception was encountered during the onHeaders event, then
118
  // return a rejected promise that wraps that exception.
119
  if ($easy->onHeadersException) {
120
- return \_PhpScoper5b6804f9734c8\GuzzleHttp\Promise\rejection_for(new \_PhpScoper5b6804f9734c8\GuzzleHttp\Exception\RequestException('An error was encountered during the on_headers event', $easy->request, $easy->response, $easy->onHeadersException, $ctx));
 
 
 
 
 
 
 
 
121
  }
122
- $message = \sprintf('cURL error %s: %s (%s)', $ctx['errno'], $ctx['error'], 'see http://curl.haxx.se/libcurl/c/libcurl-errors.html');
 
 
 
 
 
 
 
123
  // Create a connection exception if it was a specific error code.
124
- $error = isset($connectionErrors[$easy->errno]) ? new \_PhpScoper5b6804f9734c8\GuzzleHttp\Exception\ConnectException($message, $easy->request, null, $ctx) : new \_PhpScoper5b6804f9734c8\GuzzleHttp\Exception\RequestException($message, $easy->request, $easy->response, null, $ctx);
125
- return \_PhpScoper5b6804f9734c8\GuzzleHttp\Promise\rejection_for($error);
 
 
 
126
  }
127
- private function getDefaultConf(\_PhpScoper5b6804f9734c8\GuzzleHttp\Handler\EasyHandle $easy)
 
128
  {
129
- $conf = ['_headers' => $easy->request->getHeaders(), \CURLOPT_CUSTOMREQUEST => $easy->request->getMethod(), \CURLOPT_URL => (string) $easy->request->getUri()->withFragment(''), \CURLOPT_RETURNTRANSFER => \false, \CURLOPT_HEADER => \false, \CURLOPT_CONNECTTIMEOUT => 150];
130
- if (\defined('CURLOPT_PROTOCOLS')) {
131
- $conf[\CURLOPT_PROTOCOLS] = \CURLPROTO_HTTP | \CURLPROTO_HTTPS;
 
 
 
 
 
 
 
 
132
  }
 
133
  $version = $easy->request->getProtocolVersion();
134
  if ($version == 1.1) {
135
- $conf[\CURLOPT_HTTP_VERSION] = \CURL_HTTP_VERSION_1_1;
136
  } elseif ($version == 2.0) {
137
- $conf[\CURLOPT_HTTP_VERSION] = \CURL_HTTP_VERSION_2_0;
138
  } else {
139
- $conf[\CURLOPT_HTTP_VERSION] = \CURL_HTTP_VERSION_1_0;
140
  }
 
141
  return $conf;
142
  }
143
- private function applyMethod(\_PhpScoper5b6804f9734c8\GuzzleHttp\Handler\EasyHandle $easy, array &$conf)
 
144
  {
145
  $body = $easy->request->getBody();
146
  $size = $body->getSize();
 
147
  if ($size === null || $size > 0) {
148
  $this->applyBody($easy->request, $easy->options, $conf);
149
  return;
150
  }
 
151
  $method = $easy->request->getMethod();
152
  if ($method === 'PUT' || $method === 'POST') {
153
  // See http://tools.ietf.org/html/rfc7230#section-3.3.2
154
  if (!$easy->request->hasHeader('Content-Length')) {
155
- $conf[\CURLOPT_HTTPHEADER][] = 'Content-Length: 0';
156
  }
157
  } elseif ($method === 'HEAD') {
158
- $conf[\CURLOPT_NOBODY] = \true;
159
- unset($conf[\CURLOPT_WRITEFUNCTION], $conf[\CURLOPT_READFUNCTION], $conf[\CURLOPT_FILE], $conf[\CURLOPT_INFILE]);
 
 
 
 
 
160
  }
161
  }
162
- private function applyBody(\_PhpScoper5b6804f9734c8\Psr\Http\Message\RequestInterface $request, array $options, array &$conf)
 
163
  {
164
- $size = $request->hasHeader('Content-Length') ? (int) $request->getHeaderLine('Content-Length') : null;
 
 
 
165
  // Send the body as a string if the size is less than 1MB OR if the
166
  // [curl][body_as_string] request value is set.
167
- if ($size !== null && $size < 1000000 || !empty($options['_body_as_string'])) {
168
- $conf[\CURLOPT_POSTFIELDS] = (string) $request->getBody();
 
 
169
  // Don't duplicate the Content-Length header
170
  $this->removeHeader('Content-Length', $conf);
171
  $this->removeHeader('Transfer-Encoding', $conf);
172
  } else {
173
- $conf[\CURLOPT_UPLOAD] = \true;
174
  if ($size !== null) {
175
- $conf[\CURLOPT_INFILESIZE] = $size;
176
  $this->removeHeader('Content-Length', $conf);
177
  }
178
  $body = $request->getBody();
179
  if ($body->isSeekable()) {
180
  $body->rewind();
181
  }
182
- $conf[\CURLOPT_READFUNCTION] = function ($ch, $fd, $length) use($body) {
183
  return $body->read($length);
184
  };
185
  }
 
186
  // If the Expect header is not present, prevent curl from adding it
187
  if (!$request->hasHeader('Expect')) {
188
- $conf[\CURLOPT_HTTPHEADER][] = 'Expect:';
189
  }
 
190
  // cURL sometimes adds a content-type by default. Prevent this.
191
  if (!$request->hasHeader('Content-Type')) {
192
- $conf[\CURLOPT_HTTPHEADER][] = 'Content-Type:';
193
  }
194
  }
195
- private function applyHeaders(\_PhpScoper5b6804f9734c8\GuzzleHttp\Handler\EasyHandle $easy, array &$conf)
 
196
  {
197
  foreach ($conf['_headers'] as $name => $values) {
198
  foreach ($values as $value) {
@@ -200,17 +291,19 @@ class CurlFactory implements \_PhpScoper5b6804f9734c8\GuzzleHttp\Handler\CurlFac
200
  if ($value === '') {
201
  // cURL requires a special format for empty headers.
202
  // See https://github.com/guzzle/guzzle/issues/1882 for more details.
203
- $conf[\CURLOPT_HTTPHEADER][] = "{$name};";
204
  } else {
205
- $conf[\CURLOPT_HTTPHEADER][] = "{$name}: {$value}";
206
  }
207
  }
208
  }
 
209
  // Remove the Accept header if one was not set
210
  if (!$easy->request->hasHeader('Accept')) {
211
- $conf[\CURLOPT_HTTPHEADER][] = 'Accept:';
212
  }
213
  }
 
214
  /**
215
  * Remove a header from the options array.
216
  *
@@ -219,143 +312,170 @@ class CurlFactory implements \_PhpScoper5b6804f9734c8\GuzzleHttp\Handler\CurlFac
219
  */
220
  private function removeHeader($name, array &$options)
221
  {
222
- foreach (\array_keys($options['_headers']) as $key) {
223
- if (!\strcasecmp($key, $name)) {
224
  unset($options['_headers'][$key]);
225
  return;
226
  }
227
  }
228
  }
229
- private function applyHandlerOptions(\_PhpScoper5b6804f9734c8\GuzzleHttp\Handler\EasyHandle $easy, array &$conf)
 
230
  {
231
  $options = $easy->options;
232
  if (isset($options['verify'])) {
233
- if ($options['verify'] === \false) {
234
- unset($conf[\CURLOPT_CAINFO]);
235
- $conf[\CURLOPT_SSL_VERIFYHOST] = 0;
236
- $conf[\CURLOPT_SSL_VERIFYPEER] = \false;
237
  } else {
238
- $conf[\CURLOPT_SSL_VERIFYHOST] = 2;
239
- $conf[\CURLOPT_SSL_VERIFYPEER] = \true;
240
- if (\is_string($options['verify'])) {
241
  // Throw an error if the file/folder/link path is not valid or doesn't exist.
242
- if (!\file_exists($options['verify'])) {
243
- throw new \InvalidArgumentException("SSL CA bundle not found: {$options['verify']}");
 
 
244
  }
245
  // If it's a directory or a link to a directory use CURLOPT_CAPATH.
246
  // If not, it's probably a file, or a link to a file, so use CURLOPT_CAINFO.
247
- if (\is_dir($options['verify']) || \is_link($options['verify']) && \is_dir(\readlink($options['verify']))) {
248
- $conf[\CURLOPT_CAPATH] = $options['verify'];
 
249
  } else {
250
- $conf[\CURLOPT_CAINFO] = $options['verify'];
251
  }
252
  }
253
  }
254
  }
 
255
  if (!empty($options['decode_content'])) {
256
  $accept = $easy->request->getHeaderLine('Accept-Encoding');
257
  if ($accept) {
258
- $conf[\CURLOPT_ENCODING] = $accept;
259
  } else {
260
- $conf[\CURLOPT_ENCODING] = '';
261
  // Don't let curl send the header over the wire
262
- $conf[\CURLOPT_HTTPHEADER][] = 'Accept-Encoding:';
263
  }
264
  }
 
265
  if (isset($options['sink'])) {
266
  $sink = $options['sink'];
267
- if (!\is_string($sink)) {
268
- $sink = \_PhpScoper5b6804f9734c8\GuzzleHttp\Psr7\stream_for($sink);
269
- } elseif (!\is_dir(\dirname($sink))) {
270
  // Ensure that the directory exists before failing in curl.
271
- throw new \RuntimeException(\sprintf('Directory %s does not exist for sink value of %s', \dirname($sink), $sink));
 
 
 
 
272
  } else {
273
- $sink = new \_PhpScoper5b6804f9734c8\GuzzleHttp\Psr7\LazyOpenStream($sink, 'w+');
274
  }
275
  $easy->sink = $sink;
276
- $conf[\CURLOPT_WRITEFUNCTION] = function ($ch, $write) use($sink) {
277
  return $sink->write($write);
278
  };
279
  } else {
280
  // Use a default temp stream if no sink was set.
281
- $conf[\CURLOPT_FILE] = \fopen('php://temp', 'w+');
282
- $easy->sink = \_PhpScoper5b6804f9734c8\GuzzleHttp\Psr7\stream_for($conf[\CURLOPT_FILE]);
283
  }
284
- $timeoutRequiresNoSignal = \false;
285
  if (isset($options['timeout'])) {
286
  $timeoutRequiresNoSignal |= $options['timeout'] < 1;
287
- $conf[\CURLOPT_TIMEOUT_MS] = $options['timeout'] * 1000;
288
  }
 
289
  // CURL default value is CURL_IPRESOLVE_WHATEVER
290
  if (isset($options['force_ip_resolve'])) {
291
  if ('v4' === $options['force_ip_resolve']) {
292
- $conf[\CURLOPT_IPRESOLVE] = \CURL_IPRESOLVE_V4;
293
  } elseif ('v6' === $options['force_ip_resolve']) {
294
- $conf[\CURLOPT_IPRESOLVE] = \CURL_IPRESOLVE_V6;
295
  }
296
  }
 
297
  if (isset($options['connect_timeout'])) {
298
  $timeoutRequiresNoSignal |= $options['connect_timeout'] < 1;
299
- $conf[\CURLOPT_CONNECTTIMEOUT_MS] = $options['connect_timeout'] * 1000;
300
  }
301
- if ($timeoutRequiresNoSignal && \strtoupper(\substr(\PHP_OS, 0, 3)) !== 'WIN') {
302
- $conf[\CURLOPT_NOSIGNAL] = \true;
 
303
  }
 
304
  if (isset($options['proxy'])) {
305
- if (!\is_array($options['proxy'])) {
306
- $conf[\CURLOPT_PROXY] = $options['proxy'];
307
  } else {
308
  $scheme = $easy->request->getUri()->getScheme();
309
  if (isset($options['proxy'][$scheme])) {
310
  $host = $easy->request->getUri()->getHost();
311
- if (!isset($options['proxy']['no']) || !\_PhpScoper5b6804f9734c8\GuzzleHttp\is_host_in_noproxy($host, $options['proxy']['no'])) {
312
- $conf[\CURLOPT_PROXY] = $options['proxy'][$scheme];
 
 
313
  }
314
  }
315
  }
316
  }
 
317
  if (isset($options['cert'])) {
318
  $cert = $options['cert'];
319
- if (\is_array($cert)) {
320
- $conf[\CURLOPT_SSLCERTPASSWD] = $cert[1];
321
  $cert = $cert[0];
322
  }
323
- if (!\file_exists($cert)) {
324
- throw new \InvalidArgumentException("SSL certificate not found: {$cert}");
 
 
325
  }
326
- $conf[\CURLOPT_SSLCERT] = $cert;
327
  }
 
328
  if (isset($options['ssl_key'])) {
329
  $sslKey = $options['ssl_key'];
330
- if (\is_array($sslKey)) {
331
- $conf[\CURLOPT_SSLKEYPASSWD] = $sslKey[1];
332
  $sslKey = $sslKey[0];
333
  }
334
- if (!\file_exists($sslKey)) {
335
- throw new \InvalidArgumentException("SSL private key not found: {$sslKey}");
 
 
336
  }
337
- $conf[\CURLOPT_SSLKEY] = $sslKey;
338
  }
 
339
  if (isset($options['progress'])) {
340
  $progress = $options['progress'];
341
- if (!\is_callable($progress)) {
342
- throw new \InvalidArgumentException('progress client option must be callable');
 
 
343
  }
344
- $conf[\CURLOPT_NOPROGRESS] = \false;
345
- $conf[\CURLOPT_PROGRESSFUNCTION] = function () use($progress) {
346
- $args = \func_get_args();
347
  // PHP 5.5 pushed the handle onto the start of the args
348
- if (\is_resource($args[0])) {
349
- \array_shift($args);
350
  }
351
- \call_user_func_array($progress, $args);
352
  };
353
  }
 
354
  if (!empty($options['debug'])) {
355
- $conf[\CURLOPT_STDERR] = \_PhpScoper5b6804f9734c8\GuzzleHttp\debug_resource($options['debug']);
356
- $conf[\CURLOPT_VERBOSE] = \true;
357
  }
358
  }
 
359
  /**
360
  * This function ensures that a response was set on a transaction. If one
361
  * was not set, then the request is retried if possible. This error
@@ -365,8 +485,11 @@ class CurlFactory implements \_PhpScoper5b6804f9734c8\GuzzleHttp\Handler\CurlFac
365
  * error, causing the request to be sent through curl_multi_info_read()
366
  * without an error status.
367
  */
368
- private static function retryFailedRewind(callable $handler, \_PhpScoper5b6804f9734c8\GuzzleHttp\Handler\EasyHandle $easy, array $ctx)
369
- {
 
 
 
370
  try {
371
  // Only rewind if the body has been read from.
372
  $body = $easy->request->getBody();
@@ -374,34 +497,51 @@ class CurlFactory implements \_PhpScoper5b6804f9734c8\GuzzleHttp\Handler\CurlFac
374
  $body->rewind();
375
  }
376
  } catch (\RuntimeException $e) {
377
- $ctx['error'] = 'The connection unexpectedly failed without ' . 'providing an error. The request would have been retried, ' . 'but attempting to rewind the request body failed. ' . 'Exception: ' . $e;
 
 
 
378
  return self::createRejection($easy, $ctx);
379
  }
 
380
  // Retry no more than 3 times before giving up.
381
  if (!isset($easy->options['_curl_retries'])) {
382
  $easy->options['_curl_retries'] = 1;
383
  } elseif ($easy->options['_curl_retries'] == 2) {
384
- $ctx['error'] = 'The cURL request was retried 3 times ' . 'and did not succeed. The most likely reason for the failure ' . 'is that cURL was unable to rewind the body of the request ' . 'and subsequent retries resulted in the same error. Turn on ' . 'the debug option to see what went wrong. See ' . 'https://bugs.php.net/bug.php?id=47204 for more information.';
 
 
 
 
 
385
  return self::createRejection($easy, $ctx);
386
  } else {
387
  $easy->options['_curl_retries']++;
388
  }
 
389
  return $handler($easy->request, $easy->options);
390
  }
391
- private function createHeaderFn(\_PhpScoper5b6804f9734c8\GuzzleHttp\Handler\EasyHandle $easy)
 
392
  {
393
  if (isset($easy->options['on_headers'])) {
394
  $onHeaders = $easy->options['on_headers'];
395
- if (!\is_callable($onHeaders)) {
 
396
  throw new \InvalidArgumentException('on_headers must be callable');
397
  }
398
  } else {
399
  $onHeaders = null;
400
  }
401
- return function ($ch, $h) use($onHeaders, $easy, &$startingResponse) {
402
- $value = \trim($h);
 
 
 
 
 
403
  if ($value === '') {
404
- $startingResponse = \true;
405
  $easy->createResponse();
406
  if ($onHeaders !== null) {
407
  try {
@@ -414,12 +554,12 @@ class CurlFactory implements \_PhpScoper5b6804f9734c8\GuzzleHttp\Handler\CurlFac
414
  }
415
  }
416
  } elseif ($startingResponse) {
417
- $startingResponse = \false;
418
  $easy->headers = [$value];
419
  } else {
420
  $easy->headers[] = $value;
421
  }
422
- return \strlen($h);
423
  };
424
  }
425
  }
1
  <?php
2
+ namespace GuzzleHttp\Handler;
3
 
4
+ use GuzzleHttp\Exception\RequestException;
5
+ use GuzzleHttp\Exception\ConnectException;
6
+ use GuzzleHttp\Promise\FulfilledPromise;
7
+ use GuzzleHttp\Psr7;
8
+ use GuzzleHttp\Psr7\LazyOpenStream;
9
+ use GuzzleHttp\TransferStats;
10
+ use Psr\Http\Message\RequestInterface;
11
 
 
 
 
 
 
 
 
12
  /**
13
  * Creates curl resources from a request
14
  */
15
+ class CurlFactory implements CurlFactoryInterface
16
  {
17
  /** @var array */
18
  private $handles = [];
19
+
20
  /** @var int Total number of idle handles to keep in cache */
21
  private $maxHandles;
22
+
23
  /**
24
  * @param int $maxHandles Maximum number of idle handles.
25
  */
27
  {
28
  $this->maxHandles = $maxHandles;
29
  }
30
+
31
+ public function create(RequestInterface $request, array $options)
32
  {
33
  if (isset($options['curl']['body_as_string'])) {
34
  $options['_body_as_string'] = $options['curl']['body_as_string'];
35
  unset($options['curl']['body_as_string']);
36
  }
37
+
38
+ $easy = new EasyHandle;
39
  $easy->request = $request;
40
  $easy->options = $options;
41
  $conf = $this->getDefaultConf($easy);
43
  $this->applyHandlerOptions($easy, $conf);
44
  $this->applyHeaders($easy, $conf);
45
  unset($conf['_headers']);
46
+
47
  // Add handler options from the request configuration options
48
  if (isset($options['curl'])) {
49
+ $conf = array_replace($conf, $options['curl']);
50
  }
51
+
52
+ $conf[CURLOPT_HEADERFUNCTION] = $this->createHeaderFn($easy);
53
+ $easy->handle = $this->handles
54
+ ? array_pop($this->handles)
55
+ : curl_init();
56
+ curl_setopt_array($easy->handle, $conf);
57
+
58
  return $easy;
59
  }
60
+
61
+ public function release(EasyHandle $easy)
62
  {
63
  $resource = $easy->handle;
64
  unset($easy->handle);
65
+
66
+ if (count($this->handles) >= $this->maxHandles) {
67
+ curl_close($resource);
68
  } else {
69
  // Remove all callback functions as they can hold onto references
70
  // and are not cleaned up by curl_reset. Using curl_setopt_array
71
  // does not work for some reason, so removing each one
72
  // individually.
73
+ curl_setopt($resource, CURLOPT_HEADERFUNCTION, null);
74
+ curl_setopt($resource, CURLOPT_READFUNCTION, null);
75
+ curl_setopt($resource, CURLOPT_WRITEFUNCTION, null);
76
+ curl_setopt($resource, CURLOPT_PROGRESSFUNCTION, null);
77
+ curl_reset($resource);
78
  $this->handles[] = $resource;
79
  }
80
  }
81
+
82
  /**
83
  * Completes a cURL transaction, either returning a response promise or a
84
  * rejected promise.
89
  *
90
  * @return \GuzzleHttp\Promise\PromiseInterface
91
  */
92
+ public static function finish(
93
+ callable $handler,
94
+ EasyHandle $easy,
95
+ CurlFactoryInterface $factory
96
+ ) {
97
  if (isset($easy->options['on_stats'])) {
98
  self::invokeStats($easy);
99
  }
100
+
101
  if (!$easy->response || $easy->errno) {
102
  return self::finishError($handler, $easy, $factory);
103
  }
104
+
105
  // Return the response if it is present and there is no error.
106
  $factory->release($easy);
107
+
108
  // Rewind the body of the response if possible.
109
  $body = $easy->response->getBody();
110
  if ($body->isSeekable()) {
111
  $body->rewind();
112
  }
113
+
114
+ return new FulfilledPromise($easy->response);
115
  }
116
+
117
+ private static function invokeStats(EasyHandle $easy)
118
  {
119
+ $curlStats = curl_getinfo($easy->handle);
120
+ $stats = new TransferStats(
121
+ $easy->request,
122
+ $easy->response,
123
+ $curlStats['total_time'],
124
+ $easy->errno,
125
+ $curlStats
126
+ );
127
+ call_user_func($easy->options['on_stats'], $stats);
128
  }
129
+
130
+ private static function finishError(
131
+ callable $handler,
132
+ EasyHandle $easy,
133
+ CurlFactoryInterface $factory
134
+ ) {
135
  // Get error information and release the handle to the factory.
136
+ $ctx = [
137
+ 'errno' => $easy->errno,
138
+ 'error' => curl_error($easy->handle),
139
+ ] + curl_getinfo($easy->handle);
140
  $factory->release($easy);
141
+
142
  // Retry when nothing is present or when curl failed to rewind.
143
+ if (empty($easy->options['_err_message'])
144
+ && (!$easy->errno || $easy->errno == 65)
145
+ ) {
146
  return self::retryFailedRewind($handler, $easy, $ctx);
147
  }
148
+
149
  return self::createRejection($easy, $ctx);
150
  }
151
+
152
+ private static function createRejection(EasyHandle $easy, array $ctx)
153
  {
154
+ static $connectionErrors = [
155
+ CURLE_OPERATION_TIMEOUTED => true,
156
+ CURLE_COULDNT_RESOLVE_HOST => true,
157
+ CURLE_COULDNT_CONNECT => true,
158
+ CURLE_SSL_CONNECT_ERROR => true,
159
+ CURLE_GOT_NOTHING => true,
160
+ ];
161
+
162
  // If an exception was encountered during the onHeaders event, then
163
  // return a rejected promise that wraps that exception.
164
  if ($easy->onHeadersException) {
165
+ return \GuzzleHttp\Promise\rejection_for(
166
+ new RequestException(
167
+ 'An error was encountered during the on_headers event',
168
+ $easy->request,
169
+ $easy->response,
170
+ $easy->onHeadersException,
171
+ $ctx
172
+ )
173
+ );
174
  }
175
+
176
+ $message = sprintf(
177
+ 'cURL error %s: %s (%s)',
178
+ $ctx['errno'],
179
+ $ctx['error'],
180
+ 'see http://curl.haxx.se/libcurl/c/libcurl-errors.html'
181
+ );
182
+
183
  // Create a connection exception if it was a specific error code.
184
+ $error = isset($connectionErrors[$easy->errno])
185
+ ? new ConnectException($message, $easy->request, null, $ctx)
186
+ : new RequestException($message, $easy->request, $easy->response, null, $ctx);
187
+
188
+ return \GuzzleHttp\Promise\rejection_for($error);
189
  }
190
+
191
+ private function getDefaultConf(EasyHandle $easy)
192
  {
193
+ $conf = [
194
+ '_headers' => $easy->request->getHeaders(),
195
+ CURLOPT_CUSTOMREQUEST => $easy->request->getMethod(),
196
+ CURLOPT_URL => (string) $easy->request->getUri()->withFragment(''),
197
+ CURLOPT_RETURNTRANSFER => false,
198
+ CURLOPT_HEADER => false,
199
+ CURLOPT_CONNECTTIMEOUT => 150,
200
+ ];
201
+
202
+ if (defined('CURLOPT_PROTOCOLS')) {
203
+ $conf[CURLOPT_PROTOCOLS] = CURLPROTO_HTTP | CURLPROTO_HTTPS;
204
  }
205
+
206
  $version = $easy->request->getProtocolVersion();
207
  if ($version == 1.1) {
208
+ $conf[CURLOPT_HTTP_VERSION] = CURL_HTTP_VERSION_1_1;
209
  } elseif ($version == 2.0) {
210
+ $conf[CURLOPT_HTTP_VERSION] = CURL_HTTP_VERSION_2_0;
211
  } else {
212
+ $conf[CURLOPT_HTTP_VERSION] = CURL_HTTP_VERSION_1_0;
213
  }
214
+
215
  return $conf;
216
  }
217
+
218
+ private function applyMethod(EasyHandle $easy, array &$conf)
219
  {
220
  $body = $easy->request->getBody();
221
  $size = $body->getSize();
222
+
223
  if ($size === null || $size > 0) {
224
  $this->applyBody($easy->request, $easy->options, $conf);
225
  return;
226
  }
227
+
228
  $method = $easy->request->getMethod();
229
  if ($method === 'PUT' || $method === 'POST') {
230
  // See http://tools.ietf.org/html/rfc7230#section-3.3.2
231
  if (!$easy->request->hasHeader('Content-Length')) {
232
+ $conf[CURLOPT_HTTPHEADER][] = 'Content-Length: 0';
233
  }
234
  } elseif ($method === 'HEAD') {
235
+ $conf[CURLOPT_NOBODY] = true;
236
+ unset(
237
+ $conf[CURLOPT_WRITEFUNCTION],
238
+ $conf[CURLOPT_READFUNCTION],
239
+ $conf[CURLOPT_FILE],
240
+ $conf[CURLOPT_INFILE]
241
+ );
242
  }
243
  }
244
+
245
+ private function applyBody(RequestInterface $request, array $options, array &$conf)
246
  {
247
+ $size = $request->hasHeader('Content-Length')
248
+ ? (int) $request->getHeaderLine('Content-Length')
249
+ : null;
250
+
251
  // Send the body as a string if the size is less than 1MB OR if the
252
  // [curl][body_as_string] request value is set.
253
+ if (($size !== null && $size < 1000000) ||
254
+ !empty($options['_body_as_string'])
255
+ ) {
256
+ $conf[CURLOPT_POSTFIELDS] = (string) $request->getBody();
257
  // Don't duplicate the Content-Length header
258
  $this->removeHeader('Content-Length', $conf);
259
  $this->removeHeader('Transfer-Encoding', $conf);
260
  } else {
261
+ $conf[CURLOPT_UPLOAD] = true;
262
  if ($size !== null) {
263
+ $conf[CURLOPT_INFILESIZE] = $size;
264
  $this->removeHeader('Content-Length', $conf);
265
  }
266
  $body = $request->getBody();
267
  if ($body->isSeekable()) {
268
  $body->rewind();
269
  }
270
+ $conf[CURLOPT_READFUNCTION] = function ($ch, $fd, $length) use ($body) {
271
  return $body->read($length);
272
  };
273
  }
274
+
275
  // If the Expect header is not present, prevent curl from adding it
276
  if (!$request->hasHeader('Expect')) {
277
+ $conf[CURLOPT_HTTPHEADER][] = 'Expect:';
278
  }
279
+
280
  // cURL sometimes adds a content-type by default. Prevent this.
281
  if (!$request->hasHeader('Content-Type')) {
282
+ $conf[CURLOPT_HTTPHEADER][] = 'Content-Type:';
283
  }
284
  }
285
+
286
+ private function applyHeaders(EasyHandle $easy, array &$conf)
287
  {
288
  foreach ($conf['_headers'] as $name => $values) {
289
  foreach ($values as $value) {
291
  if ($value === '') {
292
  // cURL requires a special format for empty headers.
293
  // See https://github.com/guzzle/guzzle/issues/1882 for more details.
294
+ $conf[CURLOPT_HTTPHEADER][] = "$name;";
295
  } else {
296
+ $conf[CURLOPT_HTTPHEADER][] = "$name: $value";
297
  }
298
  }
299
  }
300
+
301
  // Remove the Accept header if one was not set
302
  if (!$easy->request->hasHeader('Accept')) {
303
+ $conf[CURLOPT_HTTPHEADER][] = 'Accept:';
304
  }
305
  }
306
+
307
  /**
308
  * Remove a header from the options array.
309
  *
312
  */
313
  private function removeHeader($name, array &$options)
314
  {
315
+ foreach (array_keys($options['_headers']) as $key) {
316
+ if (!strcasecmp($key, $name)) {
317
  unset($options['_headers'][$key]);
318
  return;
319
  }
320
  }
321
  }
322
+
323
+ private function applyHandlerOptions(EasyHandle $easy, array &$conf)
324
  {
325
  $options = $easy->options;
326
  if (isset($options['verify'])) {
327
+ if ($options['verify'] === false) {
328
+ unset($conf[CURLOPT_CAINFO]);
329
+ $conf[CURLOPT_SSL_VERIFYHOST] = 0;
330
+ $conf[CURLOPT_SSL_VERIFYPEER] = false;
331
  } else {
332
+ $conf[CURLOPT_SSL_VERIFYHOST] = 2;
333
+ $conf[CURLOPT_SSL_VERIFYPEER] = true;
334
+ if (is_string($options['verify'])) {
335
  // Throw an error if the file/folder/link path is not valid or doesn't exist.
336
+ if (!file_exists($options['verify'])) {
337
+ throw new \InvalidArgumentException(
338
+ "SSL CA bundle not found: {$options['verify']}"
339
+ );
340
  }
341
  // If it's a directory or a link to a directory use CURLOPT_CAPATH.
342
  // If not, it's probably a file, or a link to a file, so use CURLOPT_CAINFO.
343
+ if (is_dir($options['verify']) ||
344
+ (is_link($options['verify']) && is_dir(readlink($options['verify'])))) {
345
+ $conf[CURLOPT_CAPATH] = $options['verify'];
346
  } else {
347
+ $conf[CURLOPT_CAINFO] = $options['verify'];
348
  }
349
  }
350
  }
351
  }
352
+
353
  if (!empty($options['decode_content'])) {
354
  $accept = $easy->request->getHeaderLine('Accept-Encoding');
355
  if ($accept) {
356
+ $conf[CURLOPT_ENCODING] = $accept;
357
  } else {
358
+ $conf[CURLOPT_ENCODING] = '';
359
  // Don't let curl send the header over the wire
360
+ $conf[CURLOPT_HTTPHEADER][] = 'Accept-Encoding:';
361
  }
362
  }
363
+
364
  if (isset($options['sink'])) {
365
  $sink = $options['sink'];
366
+ if (!is_string($sink)) {
367
+ $sink = \GuzzleHttp\Psr7\stream_for($sink);
368
+ } elseif (!is_dir(dirname($sink))) {
369
  // Ensure that the directory exists before failing in curl.
370
+ throw new \RuntimeException(sprintf(
371
+ 'Directory %s does not exist for sink value of %s',
372
+ dirname($sink),
373
+ $sink
374
+ ));
375
  } else {
376
+ $sink = new LazyOpenStream($sink, 'w+');
377
  }
378
  $easy->sink = $sink;
379
+ $conf[CURLOPT_WRITEFUNCTION] = function ($ch, $write) use ($sink) {
380
  return $sink->write($write);
381
  };
382
  } else {
383
  // Use a default temp stream if no sink was set.
384
+ $conf[CURLOPT_FILE] = fopen('php://temp', 'w+');
385
+ $easy->sink = Psr7\stream_for($conf[CURLOPT_FILE]);
386
  }
387
+ $timeoutRequiresNoSignal = false;
388
  if (isset($options['timeout'])) {
389
  $timeoutRequiresNoSignal |= $options['timeout'] < 1;
390
+ $conf[CURLOPT_TIMEOUT_MS] = $options['timeout'] * 1000;
391
  }
392
+
393
  // CURL default value is CURL_IPRESOLVE_WHATEVER
394
  if (isset($options['force_ip_resolve'])) {
395
  if ('v4' === $options['force_ip_resolve']) {
396
+ $conf[CURLOPT_IPRESOLVE] = CURL_IPRESOLVE_V4;
397
  } elseif ('v6' === $options['force_ip_resolve']) {
398
+ $conf[CURLOPT_IPRESOLVE] = CURL_IPRESOLVE_V6;
399
  }
400
  }
401
+
402
  if (isset($options['connect_timeout'])) {
403
  $timeoutRequiresNoSignal |= $options['connect_timeout'] < 1;
404
+ $conf[CURLOPT_CONNECTTIMEOUT_MS] = $options['connect_timeout'] * 1000;
405
  }
406
+
407
+ if ($timeoutRequiresNoSignal && strtoupper(substr(PHP_OS, 0, 3)) !== 'WIN') {
408
+ $conf[CURLOPT_NOSIGNAL] = true;
409
  }
410
+
411
  if (isset($options['proxy'])) {
412
+ if (!is_array($options['proxy'])) {
413
+ $conf[CURLOPT_PROXY] = $options['proxy'];
414
  } else {
415
  $scheme = $easy->request->getUri()->getScheme();
416
  if (isset($options['proxy'][$scheme])) {
417
  $host = $easy->request->getUri()->getHost();
418
+ if (!isset($options['proxy']['no']) ||
419
+ !\GuzzleHttp\is_host_in_noproxy($host, $options['proxy']['no'])
420
+ ) {
421
+ $conf[CURLOPT_PROXY] = $options['proxy'][$scheme];
422
  }
423
  }
424
  }
425
  }
426
+
427
  if (isset($options['cert'])) {
428
  $cert = $options['cert'];
429
+ if (is_array($cert)) {
430
+ $conf[CURLOPT_SSLCERTPASSWD] = $cert[1];
431
  $cert = $cert[0];
432
  }
433
+ if (!file_exists($cert)) {
434
+ throw new \InvalidArgumentException(
435
+ "SSL certificate not found: {$cert}"
436
+ );
437
  }
438
+ $conf[CURLOPT_SSLCERT] = $cert;
439
  }
440
+
441
  if (isset($options['ssl_key'])) {
442
  $sslKey = $options['ssl_key'];
443
+ if (is_array($sslKey)) {
444
+ $conf[CURLOPT_SSLKEYPASSWD] = $sslKey[1];
445
  $sslKey = $sslKey[0];
446
  }
447
+ if (!file_exists($sslKey)) {
448
+ throw new \InvalidArgumentException(
449
+ "SSL private key not found: {$sslKey}"
450
+ );
451
  }
452
+ $conf[CURLOPT_SSLKEY] = $sslKey;
453
  }
454
+
455
  if (isset($options['progress'])) {
456
  $progress = $options['progress'];
457
+ if (!is_callable($progress)) {
458
+ throw new \InvalidArgumentException(
459
+ 'progress client option must be callable'
460
+ );
461
  }
462
+ $conf[CURLOPT_NOPROGRESS] = false;
463
+ $conf[CURLOPT_PROGRESSFUNCTION] = function () use ($progress) {
464
+ $args = func_get_args();
465
  // PHP 5.5 pushed the handle onto the start of the args
466
+ if (is_resource($args[0])) {
467
+ array_shift($args);
468
  }
469
+ call_user_func_array($progress, $args);
470
  };
471
  }
472
+
473
  if (!empty($options['debug'])) {
474
+ $conf[CURLOPT_STDERR] = \GuzzleHttp\debug_resource($options['debug']);
475
+ $conf[CURLOPT_VERBOSE] = true;
476
  }
477
  }
478
+
479
  /**
480
  * This function ensures that a response was set on a transaction. If one
481
  * was not set, then the request is retried if possible. This error
485
  * error, causing the request to be sent through curl_multi_info_read()
486
  * without an error status.
487
  */
488
+ private static function retryFailedRewind(
489
+ callable $handler,
490
+ EasyHandle $easy,
491
+ array $ctx
492
+ ) {
493
  try {
494
  // Only rewind if the body has been read from.
495
  $body = $easy->request->getBody();
497
  $body->rewind();
498
  }
499
  } catch (\RuntimeException $e) {
500
+ $ctx['error'] = 'The connection unexpectedly failed without '
501
+ . 'providing an error. The request would have been retried, '
502
+ . 'but attempting to rewind the request body failed. '
503
+ . 'Exception: ' . $e;
504
  return self::createRejection($easy, $ctx);
505
  }
506
+
507
  // Retry no more than 3 times before giving up.
508
  if (!isset($easy->options['_curl_retries'])) {
509
  $easy->options['_curl_retries'] = 1;
510
  } elseif ($easy->options['_curl_retries'] == 2) {
511
+ $ctx['error'] = 'The cURL request was retried 3 times '
512
+ . 'and did not succeed. The most likely reason for the failure '
513
+ . 'is that cURL was unable to rewind the body of the request '
514
+ . 'and subsequent retries resulted in the same error. Turn on '
515
+ . 'the debug option to see what went wrong. See '
516
+ . 'https://bugs.php.net/bug.php?id=47204 for more information.';
517
  return self::createRejection($easy, $ctx);
518
  } else {
519
  $easy->options['_curl_retries']++;
520
  }
521
+
522
  return $handler($easy->request, $easy->options);
523
  }
524
+
525
+ private function createHeaderFn(EasyHandle $easy)
526
  {
527
  if (isset($easy->options['on_headers'])) {
528
  $onHeaders = $easy->options['on_headers'];
529
+
530
+ if (!is_callable($onHeaders)) {
531
  throw new \InvalidArgumentException('on_headers must be callable');
532
  }
533
  } else {
534
  $onHeaders = null;
535
  }
536
+
537
+ return function ($ch, $h) use (
538
+ $onHeaders,
539
+ $easy,
540
+ &$startingResponse
541
+ ) {
542
+ $value = trim($h);
543
  if ($value === '') {
544
+ $startingResponse = true;
545
  $easy->createResponse();
546
  if ($onHeaders !== null) {
547
  try {
554
  }
555
  }
556
  } elseif ($startingResponse) {
557
+ $startingResponse = false;
558
  $easy->headers = [$value];
559
  } else {
560
  $easy->headers[] = $value;
561
  }
562
+ return strlen($h);
563
  };
564
  }
565
  }
includes/mollie-api-php/vendor/guzzlehttp/guzzle/src/Handler/CurlFactoryInterface.php CHANGED
@@ -1,8 +1,8 @@
1
  <?php
 
2
 
3
- namespace _PhpScoper5b6804f9734c8\GuzzleHttp\Handler;
4
 
5
- use _PhpScoper5b6804f9734c8\Psr\Http\Message\RequestInterface;
6
  interface CurlFactoryInterface
7
  {
8
  /**
@@ -14,7 +14,8 @@ interface CurlFactoryInterface
14
  * @return EasyHandle
15
  * @throws \RuntimeException when an option cannot be applied
16
  */
17
- public function create(\_PhpScoper5b6804f9734c8\Psr\Http\Message\RequestInterface $request, array $options);
 
18
  /**
19
  * Release an easy handle, allowing it to be reused or closed.
20
  *
@@ -22,5 +23,5 @@ interface CurlFactoryInterface
22
  *
23
  * @param EasyHandle $easy
24
  */
25
- public function release(\_PhpScoper5b6804f9734c8\GuzzleHttp\Handler\EasyHandle $easy);
26
  }
1
  <?php
2
+ namespace GuzzleHttp\Handler;
3
 
4
+ use Psr\Http\Message\RequestInterface;
5
 
 
6
  interface CurlFactoryInterface
7
  {
8
  /**
14
  * @return EasyHandle
15
  * @throws \RuntimeException when an option cannot be applied
16
  */
17
+ public function create(RequestInterface $request, array $options);
18
+
19
  /**
20
  * Release an easy handle, allowing it to be reused or closed.
21
  *
23
  *
24
  * @param EasyHandle $easy
25
  */
26
+ public function release(EasyHandle $easy);
27
  }
includes/mollie-api-php/vendor/guzzlehttp/guzzle/src/Handler/CurlHandler.php CHANGED
@@ -1,9 +1,9 @@
1
  <?php
 
2
 
3
- namespace _PhpScoper5b6804f9734c8\GuzzleHttp\Handler;
 
4
 
5
- use _PhpScoper5b6804f9734c8\GuzzleHttp\Psr7;
6
- use _PhpScoper5b6804f9734c8\Psr\Http\Message\RequestInterface;
7
  /**
8
  * HTTP handler that uses cURL easy handles as a transport layer.
9
  *
@@ -15,6 +15,7 @@ class CurlHandler
15
  {
16
  /** @var CurlFactoryInterface */
17
  private $factory;
 
18
  /**
19
  * Accepts an associative array of options:
20
  *
@@ -24,16 +25,21 @@ class CurlHandler
24
  */
25
  public function __construct(array $options = [])
26
  {
27
- $this->factory = isset($options['handle_factory']) ? $options['handle_factory'] : new \_PhpScoper5b6804f9734c8\GuzzleHttp\Handler\CurlFactory(3);
 
 
28
  }
29
- public function __invoke(\_PhpScoper5b6804f9734c8\Psr\Http\Message\RequestInterface $request, array $options)
 
30
  {
31
  if (isset($options['delay'])) {
32
- \usleep($options['delay'] * 1000);
33
  }
 
34
  $easy = $this->factory->create($request, $options);
35
- \curl_exec($easy->handle);
36
- $easy->errno = \curl_errno($easy->handle);
37
- return \_PhpScoper5b6804f9734c8\GuzzleHttp\Handler\CurlFactory::finish($this, $easy, $this->factory);
 
38
  }
39
  }
1
  <?php
2
+ namespace GuzzleHttp\Handler;
3
 
4
+ use GuzzleHttp\Psr7;
5
+ use Psr\Http\Message\RequestInterface;
6
 
 
 
7
  /**
8
  * HTTP handler that uses cURL easy handles as a transport layer.
9
  *
15
  {
16
  /** @var CurlFactoryInterface */
17
  private $factory;
18
+
19
  /**
20
  * Accepts an associative array of options:
21
  *
25
  */
26
  public function __construct(array $options = [])
27
  {
28
+ $this->factory = isset($options['handle_factory'])
29
+ ? $options['handle_factory']
30
+ : new CurlFactory(3);
31
  }
32
+
33
+ public function __invoke(RequestInterface $request, array $options)
34
  {
35
  if (isset($options['delay'])) {
36
+ usleep($options['delay'] * 1000);
37
  }
38
+
39
  $easy = $this->factory->create($request, $options);
40
+ curl_exec($easy->handle);
41
+ $easy->errno = curl_errno($easy->handle);
42
+
43
+ return CurlFactory::finish($this, $easy, $this->factory);
44
  }
45
  }
includes/mollie-api-php/vendor/guzzlehttp/guzzle/src/Handler/CurlMultiHandler.php CHANGED
@@ -1,11 +1,11 @@
1
  <?php
 
2
 
3
- namespace _PhpScoper5b6804f9734c8\GuzzleHttp\Handler;
 
 
 
4
 
5
- use _PhpScoper5b6804f9734c8\GuzzleHttp\Promise as P;
6
- use _PhpScoper5b6804f9734c8\GuzzleHttp\Promise\Promise;
7
- use _PhpScoper5b6804f9734c8\GuzzleHttp\Psr7;
8
- use _PhpScoper5b6804f9734c8\Psr\Http\Message\RequestInterface;
9
  /**
10
  * Returns an asynchronous response using curl_multi_* functions.
11
  *
@@ -23,6 +23,7 @@ class CurlMultiHandler
23
  private $active;
24
  private $handles = [];
25
  private $delays = [];
 
26
  /**
27
  * This handler accepts the following options:
28
  *
@@ -34,33 +35,46 @@ class CurlMultiHandler
34
  */
35
  public function __construct(array $options = [])
36
  {
37
- $this->factory = isset($options['handle_factory']) ? $options['handle_factory'] : new \_PhpScoper5b6804f9734c8\GuzzleHttp\Handler\CurlFactory(50);
38
- $this->selectTimeout = isset($options['select_timeout']) ? $options['select_timeout'] : 1;
 
 
39
  }
 
40
  public function __get($name)
41
  {
42
  if ($name === '_mh') {
43
- return $this->_mh = \curl_multi_init();
44
  }
 
45
  throw new \BadMethodCallException();
46
  }
 
47
  public function __destruct()
48
  {
49
  if (isset($this->_mh)) {
50
- \curl_multi_close($this->_mh);
51
  unset($this->_mh);
52
  }
53
  }
54
- public function __invoke(\_PhpScoper5b6804f9734c8\Psr\Http\Message\RequestInterface $request, array $options)
 
55
  {
56
  $easy = $this->factory->create($request, $options);
57
  $id = (int) $easy->handle;
58
- $promise = new \_PhpScoper5b6804f9734c8\GuzzleHttp\Promise\Promise([$this, 'execute'], function () use($id) {
59
- return $this->cancel($id);
60
- });
 
 
 
 
 
61
  $this->addRequest(['easy' => $easy, 'deferred' => $promise]);
 
62
  return $promise;
63
  }
 
64
  /**
65
  * Ticks the curl event loop.
66
  */
@@ -68,50 +82,62 @@ class CurlMultiHandler
68
  {
69
  // Add any delayed handles if needed.
70
  if ($this->delays) {
71
- $currentTime = \microtime(\true);
72
  foreach ($this->delays as $id => $delay) {
73
  if ($currentTime >= $delay) {
74
  unset($this->delays[$id]);
75
- \curl_multi_add_handle($this->_mh, $this->handles[$id]['easy']->handle);
 
 
 
76
  }
77
  }
78
  }
 
79
  // Step through the task queue which may add additional requests.
80
- \_PhpScoper5b6804f9734c8\GuzzleHttp\Promise\queue()->run();
81
- if ($this->active && \curl_multi_select($this->_mh, $this->selectTimeout) === -1) {
 
 
 
82
  // Perform a usleep if a select returns -1.
83
  // See: https://bugs.php.net/bug.php?id=61141
84
- \usleep(250);
85
- }
86
- while (\curl_multi_exec($this->_mh, $this->active) === \CURLM_CALL_MULTI_PERFORM) {
87
  }
 
 
 
88
  $this->processMessages();
89
  }
 
90
  /**
91
  * Runs until all outstanding connections have completed.
92
  */
93
  public function execute()
94
  {
95
- $queue = \_PhpScoper5b6804f9734c8\GuzzleHttp\Promise\queue();
 
96
  while ($this->handles || !$queue->isEmpty()) {
97
  // If there are no transfers, then sleep for the next delay
98
  if (!$this->active && $this->delays) {
99
- \usleep($this->timeToNext());
100
  }
101
  $this->tick();
102
  }
103
  }
 
104
  private function addRequest(array $entry)
105
  {
106
  $easy = $entry['easy'];
107
  $id = (int) $easy->handle;
108
  $this->handles[$id] = $entry;
109
  if (empty($easy->options['delay'])) {
110
- \curl_multi_add_handle($this->_mh, $easy->handle);
111
  } else {
112
- $this->delays[$id] = \microtime(\true) + $easy->options['delay'] / 1000;
113
  }
114
  }
 
115
  /**
116
  * Cancels a handle from sending and removes references to it.
117
  *
@@ -123,38 +149,51 @@ class CurlMultiHandler
123
  {
124
  // Cannot cancel if it has been processed.
125
  if (!isset($this->handles[$id])) {
126
- return \false;
127
  }
 
128
  $handle = $this->handles[$id]['easy']->handle;
129
  unset($this->delays[$id], $this->handles[$id]);
130
- \curl_multi_remove_handle($this->_mh, $handle);
131
- \curl_close($handle);
132
- return \true;
 
133
  }
 
134
  private function processMessages()
135
  {
136
- while ($done = \curl_multi_info_read($this->_mh)) {
137
  $id = (int) $done['handle'];
138
- \curl_multi_remove_handle($this->_mh, $done['handle']);
 
139
  if (!isset($this->handles[$id])) {
140
  // Probably was cancelled.
141
  continue;
142
  }
 
143
  $entry = $this->handles[$id];
144
  unset($this->handles[$id], $this->delays[$id]);
145
  $entry['easy']->errno = $done['result'];
146
- $entry['deferred']->resolve(\_PhpScoper5b6804f9734c8\GuzzleHttp\Handler\CurlFactory::finish($this, $entry['easy'], $this->factory));
 
 
 
 
 
 
147
  }
148
  }
 
149
  private function timeToNext()
150
  {
151
- $currentTime = \microtime(\true);
152
- $nextTime = \PHP_INT_MAX;
153
  foreach ($this->delays as $time) {
154
  if ($time < $nextTime) {
155
  $nextTime = $time;
156
  }
157
  }
158
- return \max(0, $nextTime - $currentTime) * 1000000;
 
159
  }
160
  }
1
  <?php
2
+ namespace GuzzleHttp\Handler;
3
 
4
+ use GuzzleHttp\Promise as P;
5
+ use GuzzleHttp\Promise\Promise;
6
+ use GuzzleHttp\Psr7;
7
+ use Psr\Http\Message\RequestInterface;
8
 
 
 
 
 
9
  /**
10
  * Returns an asynchronous response using curl_multi_* functions.
11
  *
23
  private $active;
24
  private $handles = [];
25
  private $delays = [];
26
+
27
  /**
28
  * This handler accepts the following options:
29
  *
35
  */
36
  public function __construct(array $options = [])
37
  {
38
+ $this->factory = isset($options['handle_factory'])
39
+ ? $options['handle_factory'] : new CurlFactory(50);
40
+ $this->selectTimeout = isset($options['select_timeout'])
41
+ ? $options['select_timeout'] : 1;
42
  }
43
+
44
  public function __get($name)
45
  {
46
  if ($name === '_mh') {
47
+ return $this->_mh = curl_multi_init();
48
  }
49
+
50
  throw new \BadMethodCallException();
51
  }
52
+
53
  public function __destruct()
54
  {
55
  if (isset($this->_mh)) {
56
+ curl_multi_close($this->_mh);
57
  unset($this->_mh);
58
  }
59
  }
60
+
61
+ public function __invoke(RequestInterface $request, array $options)
62
  {
63
  $easy = $this->factory->create($request, $options);
64
  $id = (int) $easy->handle;
65
+
66
+ $promise = new Promise(
67
+ [$this, 'execute'],
68
+ function () use ($id) {
69
+ return $this->cancel($id);
70
+ }
71
+ );
72
+
73
  $this->addRequest(['easy' => $easy, 'deferred' => $promise]);
74
+
75
  return $promise;
76
  }
77
+
78
  /**
79
  * Ticks the curl event loop.
80
  */
82
  {
83
  // Add any delayed handles if needed.
84
  if ($this->delays) {
85
+ $currentTime = microtime(true);
86
  foreach ($this->delays as $id => $delay) {
87
  if ($currentTime >= $delay) {
88
  unset($this->delays[$id]);
89
+ curl_multi_add_handle(
90
+ $this->_mh,
91
+ $this->handles[$id]['easy']->handle
92
+ );
93
  }
94
  }
95
  }
96
+
97
  // Step through the task queue which may add additional requests.
98
+ P\queue()->run();
99
+
100
+ if ($this->active &&
101
+ curl_multi_select($this->_mh, $this->selectTimeout) === -1
102
+ ) {
103
  // Perform a usleep if a select returns -1.
104
  // See: https://bugs.php.net/bug.php?id=61141
105
+ usleep(250);
 
 
106
  }
107
+
108
+ while (curl_multi_exec($this->_mh, $this->active) === CURLM_CALL_MULTI_PERFORM);
109
+
110
  $this->processMessages();
111
  }
112
+
113
  /**
114
  * Runs until all outstanding connections have completed.
115
  */
116
  public function execute()
117
  {
118
+ $queue = P\queue();
119
+
120
  while ($this->handles || !$queue->isEmpty()) {
121
  // If there are no transfers, then sleep for the next delay
122
  if (!$this->active && $this->delays) {
123
+ usleep($this->timeToNext());
124
  }
125
  $this->tick();
126
  }
127
  }
128
+
129
  private function addRequest(array $entry)
130
  {
131
  $easy = $entry['easy'];
132
  $id = (int) $easy->handle;
133
  $this->handles[$id] = $entry;
134
  if (empty($easy->options['delay'])) {
135
+ curl_multi_add_handle($this->_mh, $easy->handle);
136
  } else {
137
+ $this->delays[$id] = microtime(true) + ($easy->options['delay'] / 1000);
138
  }
139
  }
140
+
141
  /**
142
  * Cancels a handle from sending and removes references to it.
143
  *
149
  {
150
  // Cannot cancel if it has been processed.
151
  if (!isset($this->handles[$id])) {
152
+ return false;
153
  }
154
+
155
  $handle = $this->handles[$id]['easy']->handle;
156
  unset($this->delays[$id], $this->handles[$id]);
157
+ curl_multi_remove_handle($this->_mh, $handle);
158
+ curl_close($handle);
159
+
160
+ return true;
161
  }
162
+
163
  private function processMessages()
164
  {
165
+ while ($done = curl_multi_info_read($this->_mh)) {
166
  $id = (int) $done['handle'];
167
+ curl_multi_remove_handle($this->_mh, $done['handle']);
168
+
169
  if (!isset($this->handles[$id])) {
170
  // Probably was cancelled.
171
  continue;
172
  }
173
+
174
  $entry = $this->handles[$id];
175
  unset($this->handles[$id], $this->delays[$id]);
176
  $entry['easy']->errno = $done['result'];
177
+ $entry['deferred']->resolve(
178
+ CurlFactory::finish(
179
+ $this,
180
+ $entry['easy'],
181
+ $this->factory
182
+ )
183
+ );
184
  }
185
  }
186
+
187
  private function timeToNext()
188
  {
189
+ $currentTime = microtime(true);
190
+ $nextTime = PHP_INT_MAX;
191
  foreach ($this->delays as $time) {
192
  if ($time < $nextTime) {
193
  $nextTime = $time;
194
  }
195
  }
196
+
197
+ return max(0, $nextTime - $currentTime) * 1000000;
198
  }
199
  }
includes/mollie-api-php/vendor/guzzlehttp/guzzle/src/Handler/EasyHandle.php CHANGED
@@ -1,11 +1,11 @@
1
  <?php
 
2
 
3
- namespace _PhpScoper5b6804f9734c8\GuzzleHttp\Handler;
 
 
 
4
 
5
- use _PhpScoper5b6804f9734c8\GuzzleHttp\Psr7\Response;
6
- use _PhpScoper5b6804f9734c8\Psr\Http\Message\RequestInterface;
7
- use _PhpScoper5b6804f9734c8\Psr\Http\Message\ResponseInterface;
8
- use _PhpScoper5b6804f9734c8\Psr\Http\Message\StreamInterface;
9
  /**
10
  * Represents a cURL easy handle and the data it populates.
11
  *
@@ -15,20 +15,28 @@ final class EasyHandle
15
  {
16
  /** @var resource cURL resource */
17
  public $handle;
 
18
  /** @var StreamInterface Where data is being written */
19
  public $sink;
 
20
  /** @var array Received HTTP headers so far */
21
  public $headers = [];
 
22
  /** @var ResponseInterface Received response (if any) */
23
  public $response;
 
24
  /** @var RequestInterface Request being sent */
25
  public $request;
 
26
  /** @var array Request options */
27
  public $options = [];
 
28
  /** @var int cURL error number (if any) */
29
  public $errno = 0;
 
30
  /** @var \Exception Exception during on_headers (if any) */
31
  public $onHeadersException;
 
32
  /**
33
  * Attach a response to the easy handle based on the received headers.
34
  *
@@ -39,15 +47,22 @@ final class EasyHandle
39
  if (empty($this->headers)) {
40
  throw new \RuntimeException('No headers have been received');
41
  }
 
42
  // HTTP-version SP status-code SP reason-phrase
43
- $startLine = \explode(' ', \array_shift($this->headers), 3);
44
- $headers = \_PhpScoper5b6804f9734c8\GuzzleHttp\headers_from_lines($this->headers);
45
- $normalizedKeys = \_PhpScoper5b6804f9734c8\GuzzleHttp\normalize_header_keys($headers);
46
- if (!empty($this->options['decode_content']) && isset($normalizedKeys['content-encoding'])) {
47
- $headers['x-encoded-content-encoding'] = $headers[$normalizedKeys['content-encoding']];
 
 
 
 
48
  unset($headers[$normalizedKeys['content-encoding']]);
49
  if (isset($normalizedKeys['content-length'])) {
50
- $headers['x-encoded-content-length'] = $headers[$normalizedKeys['content-length']];
 
 
51
  $bodyLength = (int) $this->sink->getSize();
52
  if ($bodyLength) {
53
  $headers[$normalizedKeys['content-length']] = $bodyLength;
@@ -56,12 +71,22 @@ final class EasyHandle
56
  }
57
  }
58
  }
 
59
  // Attach a response to the easy handle with the parsed headers.
60
- $this->response = new \_PhpScoper5b6804f9734c8\GuzzleHttp\Psr7\Response($startLine[1], $headers, $this->sink, \substr($startLine[0], 5), isset($startLine[2]) ? (string) $startLine[2] : null);
 
 
 
 
 
 
61
  }
 
62
  public function __get($name)
63
  {
64
- $msg = $name === 'handle' ? 'The EasyHandle has been released' : 'Invalid property: ' . $name;
 
 
65
  throw new \BadMethodCallException($msg);
66
  }
67
  }
1
  <?php
2
+ namespace GuzzleHttp\Handler;
3
 
4
+ use GuzzleHttp\Psr7\Response;
5
+ use Psr\Http\Message\RequestInterface;
6
+ use Psr\Http\Message\ResponseInterface;
7
+ use Psr\Http\Message\StreamInterface;
8
 
 
 
 
 
9
  /**
10
  * Represents a cURL easy handle and the data it populates.
11
  *
15
  {
16
  /** @var resource cURL resource */
17
  public $handle;
18
+
19
  /** @var StreamInterface Where data is being written */
20
  public $sink;
21
+
22
  /** @var array Received HTTP headers so far */
23
  public $headers = [];
24
+
25
  /** @var ResponseInterface Received response (if any) */
26
  public $response;
27
+
28
  /** @var RequestInterface Request being sent */
29
  public $request;
30
+
31
  /** @var array Request options */
32
  public $options = [];
33
+
34
  /** @var int cURL error number (if any) */
35
  public $errno = 0;
36
+
37
  /** @var \Exception Exception during on_headers (if any) */
38
  public $onHeadersException;
39
+
40
  /**
41
  * Attach a response to the easy handle based on the received headers.
42
  *
47
  if (empty($this->headers)) {
48
  throw new \RuntimeException('No headers have been received');
49
  }
50
+
51
  // HTTP-version SP status-code SP reason-phrase
52
+ $startLine = explode(' ', array_shift($this->headers), 3);
53
+ $headers = \GuzzleHttp\headers_from_lines($this->headers);
54
+ $normalizedKeys = \GuzzleHttp\normalize_header_keys($headers);
55
+
56
+ if (!empty($this->options['decode_content'])
57
+ && isset($normalizedKeys['content-encoding'])
58
+ ) {
59
+ $headers['x-encoded-content-encoding']
60
+ = $headers[$normalizedKeys['content-encoding']];
61
  unset($headers[$normalizedKeys['content-encoding']]);
62
  if (isset($normalizedKeys['content-length'])) {
63
+ $headers['x-encoded-content-length']
64
+ = $headers[$normalizedKeys['content-length']];
65
+
66
  $bodyLength = (int) $this->sink->getSize();
67
  if ($bodyLength) {
68
  $headers[$normalizedKeys['content-length']] = $bodyLength;
71
  }
72
  }
73
  }
74
+
75
  // Attach a response to the easy handle with the parsed headers.
76
+ $this->response = new Response(
77
+ $startLine[1],
78
+ $headers,
79
+ $this->sink,
80
+ substr($startLine[0], 5),
81
+ isset($startLine[2]) ? (string) $startLine[2] : null
82
+ );
83
  }
84
+
85
  public function __get($name)
86
  {
87
+ $msg = $name === 'handle'
88
+ ? 'The EasyHandle has been released'
89
+ : 'Invalid property: ' . $name;
90
  throw new \BadMethodCallException($msg);
91
  }
92
  }
includes/mollie-api-php/vendor/guzzlehttp/guzzle/src/Handler/MockHandler.php CHANGED
@@ -1,14 +1,14 @@
1
  <?php
 
2
 
3
- namespace _PhpScoper5b6804f9734c8\GuzzleHttp\Handler;
 
 
 
 
 
 
4
 
5
- use _PhpScoper5b6804f9734c8\GuzzleHttp\Exception\RequestException;
6
- use _PhpScoper5b6804f9734c8\GuzzleHttp\HandlerStack;
7
- use _PhpScoper5b6804f9734c8\GuzzleHttp\Promise\PromiseInterface;
8
- use _PhpScoper5b6804f9734c8\GuzzleHttp\Promise\RejectedPromise;
9
- use _PhpScoper5b6804f9734c8\GuzzleHttp\TransferStats;
10
- use _PhpScoper5b6804f9734c8\Psr\Http\Message\RequestInterface;
11
- use _PhpScoper5b6804f9734c8\Psr\Http\Message\ResponseInterface;
12
  /**
13
  * Handler that returns responses or throw exceptions from a queue.
14
  */
@@ -19,6 +19,7 @@ class MockHandler implements \Countable
19
  private $lastOptions;
20
  private $onFulfilled;
21
  private $onRejected;
 
22
  /**
23
  * Creates a new MockHandler that uses the default handler stack list of
24
  * middlewares.
@@ -29,10 +30,14 @@ class MockHandler implements \Countable
29
  *
30
  * @return HandlerStack
31
  */
32
- public static function createWithMiddleware(array $queue = null, callable $onFulfilled = null, callable $onRejected = null)
33
- {
34
- return \_PhpScoper5b6804f9734c8\GuzzleHttp\HandlerStack::create(new self($queue, $onFulfilled, $onRejected));
 
 
 
35
  }
 
36
  /**
37
  * The passed in value must be an array of
38
  * {@see Psr7\Http\Message\ResponseInterface} objects, Exceptions,
@@ -42,79 +47,104 @@ class MockHandler implements \Countable
42
  * @param callable $onFulfilled Callback to invoke when the return value is fulfilled.
43
  * @param callable $onRejected Callback to invoke when the return value is rejected.
44
  */
45
- public function __construct(array $queue = null, callable $onFulfilled = null, callable $onRejected = null)
46
- {
 
 
 
47
  $this->onFulfilled = $onFulfilled;
48
  $this->onRejected = $onRejected;
 
49
  if ($queue) {
50
- \call_user_func_array([$this, 'append'], $queue);
51
  }
52
  }
53
- public function __invoke(\_PhpScoper5b6804f9734c8\Psr\Http\Message\RequestInterface $request, array $options)
 
54
  {
55
  if (!$this->queue) {
56
  throw new \OutOfBoundsException('Mock queue is empty');
57
  }
 
58
  if (isset($options['delay'])) {
59
- \usleep($options['delay'] * 1000);
60
  }
 
61
  $this->lastRequest = $request;
62
  $this->lastOptions = $options;
63
- $response = \array_shift($this->queue);
 
64
  if (isset($options['on_headers'])) {
65
- if (!\is_callable($options['on_headers'])) {
66
  throw new \InvalidArgumentException('on_headers must be callable');
67
  }
68
  try {
69
  $options['on_headers']($response);
70
  } catch (\Exception $e) {
71
  $msg = 'An error was encountered during the on_headers event';
72
- $response = new \_PhpScoper5b6804f9734c8\GuzzleHttp\Exception\RequestException($msg, $request, $response, $e);
73
  }
74
  }
75
- if (\is_callable($response)) {
76
- $response = \call_user_func($response, $request, $options);
 
77
  }
78
- $response = $response instanceof \Exception ? \_PhpScoper5b6804f9734c8\GuzzleHttp\Promise\rejection_for($response) : \_PhpScoper5b6804f9734c8\GuzzleHttp\Promise\promise_for($response);
79
- return $response->then(function ($value) use($request, $options) {
80
- $this->invokeStats($request, $options, $value);
81
- if ($this->onFulfilled) {
82
- \call_user_func($this->onFulfilled, $value);
83
- }
84
- if (isset($options['sink'])) {
85
- $contents = (string) $value->getBody();
86
- $sink = $options['sink'];
87
- if (\is_resource($sink)) {
88
- \fwrite($sink, $contents);
89
- } elseif (\is_string($sink)) {
90
- \file_put_contents($sink, $contents);
91
- } elseif ($sink instanceof \_PhpScoper5b6804f9734c8\Psr\Http\Message\StreamInterface) {
92
- $sink->write($contents);
93
  }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
94
  }
95
- return $value;
96
- }, function ($reason) use($request, $options) {
97
- $this->invokeStats($request, $options, null, $reason);
98
- if ($this->onRejected) {
99
- \call_user_func($this->onRejected, $reason);
100
- }
101
- return \_PhpScoper5b6804f9734c8\GuzzleHttp\Promise\rejection_for($reason);
102
- });
103
  }
 
104
  /**
105
  * Adds one or more variadic requests, exceptions, callables, or promises
106
  * to the queue.
107
  */
108
  public function append()
109
  {
110
- foreach (\func_get_args() as $value) {
111
- if ($value instanceof \_PhpScoper5b6804f9734c8\Psr\Http\Message\ResponseInterface || $value instanceof \Exception || $value instanceof \_PhpScoper5b6804f9734c8\GuzzleHttp\Promise\PromiseInterface || \is_callable($value)) {
 
 
 
 
112
  $this->queue[] = $value;
113
  } else {
114
- throw new \InvalidArgumentException('Expected a response or ' . 'exception. Found ' . \_PhpScoper5b6804f9734c8\GuzzleHttp\describe_type($value));
 
115
  }
116
  }
117
  }
 
118
  /**
119
  * Get the last received request.
120
  *
@@ -124,6 +154,7 @@ class MockHandler implements \Countable
124
  {
125
  return $this->lastRequest;
126
  }
 
127
  /**
128
  * Get the last received request options.
129
  *
@@ -133,6 +164,7 @@ class MockHandler implements \Countable
133
  {
134
  return $this->lastOptions;
135
  }
 
136
  /**
137
  * Returns the number of remaining items in the queue.
138
  *
@@ -140,13 +172,18 @@ class MockHandler implements \Countable
140
  */
141
  public function count()
142
  {
143
- return \count($this->queue);
144
  }
145
- private function invokeStats(\_PhpScoper5b6804f9734c8\Psr\Http\Message\RequestInterface $request, array $options, \_PhpScoper5b6804f9734c8\Psr\Http\Message\ResponseInterface $response = null, $reason = null)
146
- {
 
 
 
 
 
147
  if (isset($options['on_stats'])) {
148
- $stats = new \_PhpScoper5b6804f9734c8\GuzzleHttp\TransferStats($request, $response, 0, $reason);
149
- \call_user_func($options['on_stats'], $stats);
150
  }
151
  }
152
  }
1
  <?php
2
+ namespace GuzzleHttp\Handler;
3
 
4
+ use GuzzleHttp\Exception\RequestException;
5
+ use GuzzleHttp\HandlerStack;
6
+ use GuzzleHttp\Promise\PromiseInterface;
7
+ use GuzzleHttp\Promise\RejectedPromise;
8
+ use GuzzleHttp\TransferStats;
9
+ use Psr\Http\Message\RequestInterface;
10
+ use Psr\Http\Message\ResponseInterface;
11
 
 
 
 
 
 
 
 
12
  /**
13
  * Handler that returns responses or throw exceptions from a queue.
14
  */
19
  private $lastOptions;
20
  private $onFulfilled;
21
  private $onRejected;
22
+
23
  /**
24
  * Creates a new MockHandler that uses the default handler stack list of
25
  * middlewares.
30
  *
31
  * @return HandlerStack
32
  */
33
+ public static function createWithMiddleware(
34
+ array $queue = null,
35
+ callable $onFulfilled = null,
36
+ callable $onRejected = null
37
+ ) {
38
+ return HandlerStack::create(new self($queue, $onFulfilled, $onRejected));
39
  }
40
+
41
  /**
42
  * The passed in value must be an array of
43
  * {@see Psr7\Http\Message\ResponseInterface} objects, Exceptions,
47
  * @param callable $onFulfilled Callback to invoke when the return value is fulfilled.
48
  * @param callable $onRejected Callback to invoke when the return value is rejected.
49
  */
50
+ public function __construct(
51
+ array $queue = null,
52
+ callable $onFulfilled = null,
53
+ callable $onRejected = null
54
+ ) {
55
  $this->onFulfilled = $onFulfilled;
56
  $this->onRejected = $onRejected;
57
+
58
  if ($queue) {
59
+ call_user_func_array([$this, 'append'], $queue);
60
  }
61
  }
62
+
63
+ public function __invoke(RequestInterface $request, array $options)
64
  {
65
  if (!$this->queue) {
66
  throw new \OutOfBoundsException('Mock queue is empty');
67
  }
68
+
69
  if (isset($options['delay'])) {
70
+ usleep($options['delay'] * 1000);
71
  }
72
+
73
  $this->lastRequest = $request;
74
  $this->lastOptions = $options;
75
+ $response = array_shift($this->queue);
76
+
77
  if (isset($options['on_headers'])) {
78
+ if (!is_callable($options['on_headers'])) {
79
  throw new \InvalidArgumentException('on_headers must be callable');
80
  }
81
  try {
82
  $options['on_headers']($response);
83
  } catch (\Exception $e) {
84
  $msg = 'An error was encountered during the on_headers event';
85
+ $response = new RequestException($msg, $request, $response, $e);
86
  }
87
  }
88
+
89
+ if (is_callable($response)) {
90
+ $response = call_user_func($response, $request, $options);
91
  }
92
+
93
+ $response = $response instanceof \Exception
94
+ ? \GuzzleHttp\Promise\rejection_for($response)
95
+ : \GuzzleHttp\Promise\promise_for($response);
96
+
97
+ return $response->then(
98
+ function ($value) use ($request, $options) {
99
+ $this->invokeStats($request, $options, $value);
100
+ if ($this->onFulfilled) {
101
+ call_user_func($this->onFulfilled, $value);
 
 
 
 
 
102
  }
103
+ if (isset($options['sink'])) {
104
+ $contents = (string) $value->getBody();
105
+ $sink = $options['sink'];
106
+
107
+ if (is_resource($sink)) {
108
+ fwrite($sink, $contents);
109
+ } elseif (is_string($sink)) {
110
+ file_put_contents($sink, $contents);
111
+ } elseif ($sink instanceof \Psr\Http\Message\StreamInterface) {
112
+ $sink->write($contents);
113
+ }
114
+ }
115
+
116
+ return $value;
117
+ },
118
+ function ($reason) use ($request, $options) {
119
+ $this->invokeStats($request, $options, null, $reason);
120
+ if ($this->onRejected) {
121
+ call_user_func($this->onRejected, $reason);
122
+ }
123
+ return \GuzzleHttp\Promise\rejection_for($reason);
124
  }
125
+ );
 
 
 
 
 
 
 
126
  }
127
+
128
  /**
129
  * Adds one or more variadic requests, exceptions, callables, or promises
130
  * to the queue.
131
  */
132
  public function append()
133
  {
134
+ foreach (func_get_args() as $value) {
135
+ if ($value instanceof ResponseInterface
136
+ || $value instanceof \Exception
137
+ || $value instanceof PromiseInterface
138
+ || is_callable($value)
139
+ ) {
140
  $this->queue[] = $value;
141
  } else {
142
+ throw new \InvalidArgumentException('Expected a response or '
143
+ . 'exception. Found ' . \GuzzleHttp\describe_type($value));
144
  }
145
  }
146
  }
147
+
148
  /**
149
  * Get the last received request.
150
  *
154
  {
155
  return $this->lastRequest;
156
  }
157
+
158
  /**
159
  * Get the last received request options.
160
  *
164
  {
165
  return $this->lastOptions;
166
  }
167
+
168
  /**
169
  * Returns the number of remaining items in the queue.
170
  *
172
  */
173
  public function count()
174
  {
175
+ return count($this->queue);
176
  }
177
+
178
+ private function invokeStats(
179
+ RequestInterface $request,
180
+ array $options,
181
+ ResponseInterface $response = null,
182
+ $reason = null
183
+ ) {
184
  if (isset($options['on_stats'])) {
185
+ $stats = new TransferStats($request, $response, 0, $reason);
186
+ call_user_func($options['on_stats'], $stats);
187
  }
188
  }
189
  }
includes/mollie-api-php/vendor/guzzlehttp/guzzle/src/Handler/Proxy.php CHANGED
@@ -1,9 +1,9 @@
1
  <?php
 
2
 
3
- namespace _PhpScoper5b6804f9734c8\GuzzleHttp\Handler;
 
4
 
5
- use _PhpScoper5b6804f9734c8\GuzzleHttp\RequestOptions;
6
- use _PhpScoper5b6804f9734c8\Psr\Http\Message\RequestInterface;
7
  /**
8
  * Provides basic proxies for handlers.
9
  */
@@ -18,12 +18,17 @@ class Proxy
18
  *
19
  * @return callable Returns the composed handler.
20
  */
21
- public static function wrapSync(callable $default, callable $sync)
22
- {
23
- return function (\_PhpScoper5b6804f9734c8\Psr\Http\Message\RequestInterface $request, array $options) use($default, $sync) {
24
- return empty($options[\_PhpScoper5b6804f9734c8\GuzzleHttp\RequestOptions::SYNCHRONOUS]) ? $default($request, $options) : $sync($request, $options);
 
 
 
 
25
  };
26
  }
 
27
  /**
28
  * Sends streaming requests to a streaming compatible handler while sending
29
  * all other requests to a default handler.
@@ -37,10 +42,14 @@ class Proxy
37
  *
38
  * @return callable Returns the composed handler.
39
  */
40
- public static function wrapStreaming(callable $default, callable $streaming)
41
- {
42
- return function (\_PhpScoper5b6804f9734c8\Psr\Http\Message\RequestInterface $request, array $options) use($default, $streaming) {
43
- return empty($options['stream']) ? $default($request, $options) : $streaming($request, $options);
 
 
 
 
44
  };
45
  }
46
  }
1
  <?php
2
+ namespace GuzzleHttp\Handler;
3
 
4
+ use GuzzleHttp\RequestOptions;
5
+ use Psr\Http\Message\RequestInterface;
6
 
 
 
7
  /**
8
  * Provides basic proxies for handlers.
9
  */
18
  *
19
  * @return callable Returns the composed handler.
20
  */
21
+ public static function wrapSync(
22
+ callable $default,
23
+ callable $sync
24
+ ) {
25
+ return function (RequestInterface $request, array $options) use ($default, $sync) {
26
+ return empty($options[RequestOptions::SYNCHRONOUS])
27
+ ? $default($request, $options)
28
+ : $sync($request, $options);
29
  };
30
  }
31
+
32
  /**
33
  * Sends streaming requests to a streaming compatible handler while sending
34
  * all other requests to a default handler.
42
  *
43
  * @return callable Returns the composed handler.
44
  */
45
+ public static function wrapStreaming(
46
+ callable $default,
47
+ callable $streaming
48
+ ) {
49
+ return function (RequestInterface $request, array $options) use ($default, $streaming) {
50
+ return empty($options['stream'])
51
+ ? $default($request, $options)
52
+ : $streaming($request, $options);
53
  };
54
  }
55
  }
includes/mollie-api-php/vendor/guzzlehttp/guzzle/src/Handler/StreamHandler.php CHANGED
@@ -1,22 +1,23 @@
1
  <?php
 
 
 
 
 
 
 
 
 
 
 
2
 
3
- namespace _PhpScoper5b6804f9734c8\GuzzleHttp\Handler;
4
-
5
- use _PhpScoper5b6804f9734c8\GuzzleHttp\Exception\RequestException;
6
- use _PhpScoper5b6804f9734c8\GuzzleHttp\Exception\ConnectException;
7
- use _PhpScoper5b6804f9734c8\GuzzleHttp\Promise\FulfilledPromise;
8
- use _PhpScoper5b6804f9734c8\GuzzleHttp\Promise\PromiseInterface;
9
- use _PhpScoper5b6804f9734c8\GuzzleHttp\Psr7;
10
- use _PhpScoper5b6804f9734c8\GuzzleHttp\TransferStats;
11
- use _PhpScoper5b6804f9734c8\Psr\Http\Message\RequestInterface;
12
- use _PhpScoper5b6804f9734c8\Psr\Http\Message\ResponseInterface;
13
- use _PhpScoper5b6804f9734c8\Psr\Http\Message\StreamInterface;
14
  /**
15
  * HTTP handler that uses PHP's HTTP stream wrapper.
16
  */
17
  class StreamHandler
18
  {
19
  private $lastHeaders = [];
 
20
  /**
21
  * Sends an HTTP request.
22
  *
@@ -25,99 +26,153 @@ class StreamHandler
25
  *
26
  * @return PromiseInterface
27
  */
28
- public function __invoke(\_PhpScoper5b6804f9734c8\Psr\Http\Message\RequestInterface $request, array $options)
29
  {
30
  // Sleep if there is a delay specified.
31
  if (isset($options['delay'])) {
32
- \usleep($options['delay'] * 1000);
33
  }
34
- $startTime = isset($options['on_stats']) ? \microtime(\true) : null;
 
 
35
  try {
36
  // Does not support the expect header.
37
  $request = $request->withoutHeader('Expect');
 
38
  // Append a content-length header if body size is zero to match
39
  // cURL's behavior.
40
  if (0 === $request->getBody()->getSize()) {
41
  $request = $request->withHeader('Content-Length', 0);
42
  }
43
- return $this->createResponse($request, $options, $this->createStream($request, $options), $startTime);
 
 
 
 
 
 
44
  } catch (\InvalidArgumentException $e) {
45
  throw $e;
46
  } catch (\Exception $e) {
47
  // Determine if the error was a networking error.
48
  $message = $e->getMessage();
49
  // This list can probably get more comprehensive.
50
- if (\strpos($message, 'getaddrinfo') || \strpos($message, 'Connection refused') || \strpos($message, "couldn't connect to host") || \strpos($message, "connection attempt failed")) {
51
- $e = new \_PhpScoper5b6804f9734c8\GuzzleHttp\Exception\ConnectException($e->getMessage(), $request, $e);
 
 
 
 
52
  }
53
- $e = \_PhpScoper5b6804f9734c8\GuzzleHttp\Exception\RequestException::wrapException($request, $e);
54
  $this->invokeStats($options, $request, $startTime, null, $e);
55
- return \_PhpScoper5b6804f9734c8\GuzzleHttp\Promise\rejection_for($e);
 
56
  }
57
  }
58
- private function invokeStats(array $options, \_PhpScoper5b6804f9734c8\Psr\Http\Message\RequestInterface $request, $startTime, \_PhpScoper5b6804f9734c8\Psr\Http\Message\ResponseInterface $response = null, $error = null)
59
- {
 
 
 
 
 
 
60
  if (isset($options['on_stats'])) {
61
- $stats = new \_PhpScoper5b6804f9734c8\GuzzleHttp\TransferStats($request, $response, \microtime(\true) - $startTime, $error, []);
62
- \call_user_func($options['on_stats'], $stats);
 
 
 
 
 
 
63
  }
64
  }
65
- private function createResponse(\_PhpScoper5b6804f9734c8\Psr\Http\Message\RequestInterface $request, array $options, $stream, $startTime)
66
- {
 
 
 
 
 
67
  $hdrs = $this->lastHeaders;
68
  $this->lastHeaders = [];
69
- $parts = \explode(' ', \array_shift($hdrs), 3);
70
- $ver = \explode('/', $parts[0])[1];
71
  $status = $parts[1];
72
  $reason = isset($parts[2]) ? $parts[2] : null;
73
- $headers = \_PhpScoper5b6804f9734c8\GuzzleHttp\headers_from_lines($hdrs);
74
  list($stream, $headers) = $this->checkDecode($options, $headers, $stream);
75
- $stream = \_PhpScoper5b6804f9734c8\GuzzleHttp\Psr7\stream_for($stream);
76
  $sink = $stream;
77
- if (\strcasecmp('HEAD', $request->getMethod())) {
 
78
  $sink = $this->createSink($stream, $options);
79
  }
80
- $response = new \_PhpScoper5b6804f9734c8\GuzzleHttp\Psr7\Response($status, $headers, $sink, $ver, $reason);
 
 
81
  if (isset($options['on_headers'])) {
82
  try {
83
  $options['on_headers']($response);
84
  } catch (\Exception $e) {
85
  $msg = 'An error was encountered during the on_headers event';
86
- $ex = new \_PhpScoper5b6804f9734c8\GuzzleHttp\Exception\RequestException($msg, $request, $response, $e);
87
- return \_PhpScoper5b6804f9734c8\GuzzleHttp\Promise\rejection_for($ex);
88
  }
89
  }
 
90
  // Do not drain when the request is a HEAD request because they have
91
  // no body.
92
  if ($sink !== $stream) {
93
- $this->drain($stream, $sink, $response->getHeaderLine('Content-Length'));
 
 
 
 
94
  }
 
95
  $this->invokeStats($options, $request, $startTime, $response, null);
96
- return new \_PhpScoper5b6804f9734c8\GuzzleHttp\Promise\FulfilledPromise($response);
 
97
  }
98
- private function createSink(\_PhpScoper5b6804f9734c8\Psr\Http\Message\StreamInterface $stream, array $options)
 
99
  {
100
  if (!empty($options['stream'])) {
101
  return $stream;
102
  }
103
- $sink = isset($options['sink']) ? $options['sink'] : \fopen('php://temp', 'r+');
104
- return \is_string($sink) ? new \_PhpScoper5b6804f9734c8\GuzzleHttp\Psr7\LazyOpenStream($sink, 'w+') : \_PhpScoper5b6804f9734c8\GuzzleHttp\Psr7\stream_for($sink);
 
 
 
 
 
 
105
  }
 
106
  private function checkDecode(array $options, array $headers, $stream)
107
  {
108
  // Automatically decode responses when instructed.
109
  if (!empty($options['decode_content'])) {
110
- $normalizedKeys = \_PhpScoper5b6804f9734c8\GuzzleHttp\normalize_header_keys($headers);
111
  if (isset($normalizedKeys['content-encoding'])) {
112
  $encoding = $headers[$normalizedKeys['content-encoding']];
113
  if ($encoding[0] === 'gzip' || $encoding[0] === 'deflate') {
114
- $stream = new \_PhpScoper5b6804f9734c8\GuzzleHttp\Psr7\InflateStream(\_PhpScoper5b6804f9734c8\GuzzleHttp\Psr7\stream_for($stream));
115
- $headers['x-encoded-content-encoding'] = $headers[$normalizedKeys['content-encoding']];
 
 
 
116
  // Remove content-encoding header
117
  unset($headers[$normalizedKeys['content-encoding']]);
118
  // Fix content-length header
119
  if (isset($normalizedKeys['content-length'])) {
120
- $headers['x-encoded-content-length'] = $headers[$normalizedKeys['content-length']];
 
 
121
  $length = (int) $stream->getSize();
122
  if ($length === 0) {
123
  unset($headers[$normalizedKeys['content-length']]);
@@ -128,8 +183,10 @@ class StreamHandler
128
  }
129
  }
130
  }
 
131
  return [$stream, $headers];
132
  }
 
133
  /**
134
  * Drains the source stream into the "sink" client option.
135
  *
@@ -141,17 +198,27 @@ class StreamHandler
141
  * @return StreamInterface
142
  * @throws \RuntimeException when the sink option is invalid.
143
  */
144
- private function drain(\_PhpScoper5b6804f9734c8\Psr\Http\Message\StreamInterface $source, \_PhpScoper5b6804f9734c8\Psr\Http\Message\StreamInterface $sink, $contentLength)
145
- {
 
 
 
146
  // If a content-length header is provided, then stop reading once
147
  // that number of bytes has been read. This can prevent infinitely
148
  // reading from a stream when dealing with servers that do not honor
149
  // Connection: Close headers.
150
- \_PhpScoper5b6804f9734c8\GuzzleHttp\Psr7\copy_to_stream($source, $sink, \strlen($contentLength) > 0 && (int) $contentLength > 0 ? (int) $contentLength : -1);
 
 
 
 
 
151
  $sink->seek(0);
152
  $source->close();
 
153
  return $sink;
154
  }
 
155
  /**
156
  * Create a resource and check to ensure it was created successfully
157
  *
@@ -163,43 +230,58 @@ class StreamHandler
163
  private function createResource(callable $callback)
164
  {
165
  $errors = null;
166
- \set_error_handler(function ($_, $msg, $file, $line) use(&$errors) {
167
- $errors[] = ['message' => $msg, 'file' => $file, 'line' => $line];
168
- return \true;
 
 
 
 
169
  });
 
170
  $resource = $callback();
171
- \restore_error_handler();
 
172
  if (!$resource) {
173
  $message = 'Error creating resource: ';
174
  foreach ($errors as $err) {
175
  foreach ($err as $key => $value) {
176
- $message .= "[{$key}] {$value}" . \PHP_EOL;
177
  }
178
  }
179
- throw new \RuntimeException(\trim($message));
180
  }
 
181
  return $resource;
182
  }
183
- private function createStream(\_PhpScoper5b6804f9734c8\Psr\Http\Message\RequestInterface $request, array $options)
 
184
  {
185
  static $methods;
186
  if (!$methods) {
187
- $methods = \array_flip(\get_class_methods(__CLASS__));
188
  }
 
189
  // HTTP/1.1 streams using the PHP stream wrapper require a
190
  // Connection: close header
191
- if ($request->getProtocolVersion() == '1.1' && !$request->hasHeader('Connection')) {
 
 
192
  $request = $request->withHeader('Connection', 'close');
193
  }
 
194
  // Ensure SSL is verified by default
195
  if (!isset($options['verify'])) {
196
- $options['verify'] = \true;
197
  }
 
198
  $params = [];
199
  $context = $this->getDefaultContext($request);
200
- if (isset($options['on_headers']) && !\is_callable($options['on_headers'])) {
 
201
  throw new \InvalidArgumentException('on_headers must be callable');
202
  }
 
203
  if (!empty($options)) {
204
  foreach ($options as $key => $value) {
205
  $method = "add_{$key}";
@@ -208,62 +290,95 @@ class StreamHandler
208
  }
209
  }
210
  }
 
211
  if (isset($options['stream_context'])) {
212
- if (!\is_array($options['stream_context'])) {
213
  throw new \InvalidArgumentException('stream_context must be an array');
214
  }
215
- $context = \array_replace_recursive($context, $options['stream_context']);
 
 
 
216
  }
 
217
  // Microsoft NTLM authentication only supported with curl handler
218
- if (isset($options['auth']) && \is_array($options['auth']) && isset($options['auth'][2]) && 'ntlm' == $options['auth'][2]) {
 
 
 
 
219
  throw new \InvalidArgumentException('Microsoft NTLM authentication only supported with curl handler');
220
  }
 
221
  $uri = $this->resolveHost($request, $options);
222
- $context = $this->createResource(function () use($context, $params) {
223
- return \stream_context_create($context, $params);
224
- });
225
- return $this->createResource(function () use($uri, &$http_response_header, $context, $options) {
226
- $resource = \fopen((string) $uri, 'r', null, $context);
227
- $this->lastHeaders = $http_response_header;
228
- if (isset($options['read_timeout'])) {
229
- $readTimeout = $options['read_timeout'];
230
- $sec = (int) $readTimeout;
231
- $usec = ($readTimeout - $sec) * 100000;
232
- \stream_set_timeout($resource, $sec, $usec);
233
  }
234
- return $resource;
235
- });
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
236
  }
237
- private function resolveHost(\_PhpScoper5b6804f9734c8\Psr\Http\Message\RequestInterface $request, array $options)
 
238
  {
239
  $uri = $request->getUri();
240
- if (isset($options['force_ip_resolve']) && !\filter_var($uri->getHost(), \FILTER_VALIDATE_IP)) {
 
241
  if ('v4' === $options['force_ip_resolve']) {
242
- $records = \dns_get_record($uri->getHost(), \DNS_A);
243
  if (!isset($records[0]['ip'])) {
244
- throw new \_PhpScoper5b6804f9734c8\GuzzleHttp\Exception\ConnectException(\sprintf("Could not resolve IPv4 address for host '%s'", $uri->getHost()), $request);
245
  }
246
  $uri = $uri->withHost($records[0]['ip']);
247
  } elseif ('v6' === $options['force_ip_resolve']) {
248
- $records = \dns_get_record($uri->getHost(), \DNS_AAAA);
249
  if (!isset($records[0]['ipv6'])) {
250
- throw new \_PhpScoper5b6804f9734c8\GuzzleHttp\Exception\ConnectException(\sprintf("Could not resolve IPv6 address for host '%s'", $uri->getHost()), $request);
251
  }
252
  $uri = $uri->withHost('[' . $records[0]['ipv6'] . ']');
253
  }
254
  }
 
255
  return $uri;
256
  }
257
- private function getDefaultContext(\_PhpScoper5b6804f9734c8\Psr\Http\Message\RequestInterface $request)
 
258
  {
259
  $headers = '';
260
  foreach ($request->getHeaders() as $name => $value) {
261
  foreach ($value as $val) {
262
- $headers .= "{$name}: {$val}\r\n";
263
  }
264
  }
265
- $context = ['http' => ['method' => $request->getMethod(), 'header' => $headers, 'protocol_version' => $request->getProtocolVersion(), 'ignore_errors' => \true, 'follow_location' => 0]];
 
 
 
 
 
 
 
 
 
 
266
  $body = (string) $request->getBody();
 
267
  if (!empty($body)) {
268
  $context['http']['content'] = $body;
269
  // Prevent the HTTP handler from adding a Content-Type header.
@@ -271,105 +386,146 @@ class StreamHandler
271
  $context['http']['header'] .= "Content-Type:\r\n";
272
  }
273
  }
274
- $context['http']['header'] = \rtrim($context['http']['header']);
 
 
275
  return $context;
276
  }
277
- private function add_proxy(\_PhpScoper5b6804f9734c8\Psr\Http\Message\RequestInterface $request, &$options, $value, &$params)
 
278
  {
279
- if (!\is_array($value)) {
280
  $options['http']['proxy'] = $value;
281
  } else {
282
  $scheme = $request->getUri()->getScheme();
283
  if (isset($value[$scheme])) {
284
- if (!isset($value['no']) || !\_PhpScoper5b6804f9734c8\GuzzleHttp\is_host_in_noproxy($request->getUri()->getHost(), $value['no'])) {
 
 
 
 
 
285
  $options['http']['proxy'] = $value[$scheme];
286
  }
287
  }
288
  }
289
  }
290
- private function add_timeout(\_PhpScoper5b6804f9734c8\Psr\Http\Message\RequestInterface $request, &$options, $value, &$params)
 
291
  {
292
  if ($value > 0) {
293
  $options['http']['timeout'] = $value;
294
  }
295
  }
296
- private function add_verify(\_PhpScoper5b6804f9734c8\Psr\Http\Message\RequestInterface $request, &$options, $value, &$params)
 
297
  {
298
- if ($value === \true) {
299
  // PHP 5.6 or greater will find the system cert by default. When
300
  // < 5.6, use the Guzzle bundled cacert.
301
- if (\PHP_VERSION_ID < 50600) {
302
- $options['ssl']['cafile'] = \_PhpScoper5b6804f9734c8\GuzzleHttp\default_ca_bundle();
303
  }
304
- } elseif (\is_string($value)) {
305
  $options['ssl']['cafile'] = $value;
306
- if (!\file_exists($value)) {
307
- throw new \RuntimeException("SSL CA bundle not found: {$value}");
308
  }
309
- } elseif ($value === \false) {
310
- $options['ssl']['verify_peer'] = \false;
311
- $options['ssl']['verify_peer_name'] = \false;
312
  return;
313
  } else {
314
  throw new \InvalidArgumentException('Invalid verify request option');
315
  }
316
- $options['ssl']['verify_peer'] = \true;
317
- $options['ssl']['verify_peer_name'] = \true;
318
- $options['ssl']['allow_self_signed'] = \false;
 
319
  }
320
- private function add_cert(\_PhpScoper5b6804f9734c8\Psr\Http\Message\RequestInterface $request, &$options, $value, &$params)
 
321
  {
322
- if (\is_array($value)) {
323
  $options['ssl']['passphrase'] = $value[1];
324
  $value = $value[0];
325
  }
326
- if (!\file_exists($value)) {
 
327
  throw new \RuntimeException("SSL certificate not found: {$value}");
328
  }
 
329
  $options['ssl']['local_cert'] = $value;
330
  }
331
- private function add_progress(\_PhpScoper5b6804f9734c8\Psr\Http\Message\RequestInterface $request, &$options, $value, &$params)
 
332
  {
333
- $this->addNotification($params, function ($code, $a, $b, $c, $transferred, $total) use($value) {
334
- if ($code == \STREAM_NOTIFY_PROGRESS) {
335
- $value($total, $transferred, null, null);
 
 
 
336
  }
337
- });
338
  }
339
- private function add_debug(\_PhpScoper5b6804f9734c8\Psr\Http\Message\RequestInterface $request, &$options, $value, &$params)
 
340
  {
341
- if ($value === \false) {
342
  return;
343
  }
344
- static $map = [\STREAM_NOTIFY_CONNECT => 'CONNECT', \STREAM_NOTIFY_AUTH_REQUIRED => 'AUTH_REQUIRED', \STREAM_NOTIFY_AUTH_RESULT => 'AUTH_RESULT', \STREAM_NOTIFY_MIME_TYPE_IS => 'MIME_TYPE_IS', \STREAM_NOTIFY_FILE_SIZE_IS => 'FILE_SIZE_IS', \STREAM_NOTIFY_REDIRECTED => 'REDIRECTED', \STREAM_NOTIFY_PROGRESS => 'PROGRESS', \STREAM_NOTIFY_FAILURE => 'FAILURE', \STREAM_NOTIFY_COMPLETED => 'COMPLETED', \STREAM_NOTIFY_RESOLVE => 'RESOLVE'];
345
- static $args = ['severity', 'message', 'message_code', 'bytes_transferred', 'bytes_max'];
346
- $value = \_PhpScoper5b6804f9734c8\GuzzleHttp\debug_resource($value);
 
 
 
 
 
 
 
 
 
 
 
 
 
 
347
  $ident = $request->getMethod() . ' ' . $request->getUri()->withFragment('');
348
- $this->addNotification($params, function () use($ident, $value, $map, $args) {
349
- $passed = \func_get_args();
350
- $code = \array_shift($passed);
351
- \fprintf($value, '<%s> [%s] ', $ident, $map[$code]);
352
- foreach (\array_filter($passed) as $i => $v) {
353
- \fwrite($value, $args[$i] . ': "' . $v . '" ');
 
 
 
 
354
  }
355
- \fwrite($value, "\n");
356
- });
357
  }
 
358
  private function addNotification(array &$params, callable $notify)
359
  {
360
  // Wrap the existing function if needed.
361
  if (!isset($params['notification'])) {
362
  $params['notification'] = $notify;
363
  } else {
364
- $params['notification'] = $this->callArray([$params['notification'], $notify]);
 
 
 
365
  }
366
  }
 
367
  private function callArray(array $functions)
368
  {
369
- return function () use($functions) {
370
- $args = \func_get_args();
371
  foreach ($functions as $fn) {
372
- \call_user_func_array($fn, $args);
373
  }
374
  };
375
  }
1
  <?php
2
+ namespace GuzzleHttp\Handler;
3
+
4
+ use GuzzleHttp\Exception\RequestException;
5
+ use GuzzleHttp\Exception\ConnectException;
6
+ use GuzzleHttp\Promise\FulfilledPromise;
7
+ use GuzzleHttp\Promise\PromiseInterface;
8
+ use GuzzleHttp\Psr7;
9
+ use GuzzleHttp\TransferStats;
10
+ use Psr\Http\Message\RequestInterface;
11
+ use Psr\Http\Message\ResponseInterface;
12
+ use Psr\Http\Message\StreamInterface;
13
 
 
 
 
 
 
 
 
 
 
 
 
14
  /**
15
  * HTTP handler that uses PHP's HTTP stream wrapper.
16
  */
17
  class StreamHandler
18
  {
19
  private $lastHeaders = [];
20
+
21
  /**
22
  * Sends an HTTP request.
23
  *
26
  *
27
  * @return PromiseInterface
28
  */
29
+ public function __invoke(RequestInterface $request, array $options)
30
  {
31
  // Sleep if there is a delay specified.
32
  if (isset($options['delay'])) {
33
+ usleep($options['delay'] * 1000);
34
  }
35
+
36
+ $startTime = isset($options['on_stats']) ? microtime(true) : null;
37
+
38
  try {
39
  // Does not support the expect header.
40
  $request = $request->withoutHeader('Expect');
41
+
42
  // Append a content-length header if body size is zero to match
43
  // cURL's behavior.
44
  if (0 === $request->getBody()->getSize()) {
45
  $request = $request->withHeader('Content-Length', 0);
46
  }
47
+
48
+ return $this->createResponse(
49
+ $request,
50
+ $options,
51
+ $this->createStream($request, $options),
52
+ $startTime
53
+ );
54
  } catch (\InvalidArgumentException $e) {
55
  throw $e;
56
  } catch (\Exception $e) {
57
  // Determine if the error was a networking error.
58
  $message = $e->getMessage();
59
  // This list can probably get more comprehensive.
60
+ if (strpos($message, 'getaddrinfo') // DNS lookup failed
61
+ || strpos($message, 'Connection refused')
62
+ || strpos($message, "couldn't connect to host") // error on HHVM
63
+ || strpos($message, "connection attempt failed")
64
+ ) {
65
+ $e = new ConnectException($e->getMessage(), $request, $e);
66
  }
67
+ $e = RequestException::wrapException($request, $e);
68
  $this->invokeStats($options, $request, $startTime, null, $e);
69
+
70
+ return \GuzzleHttp\Promise\rejection_for($e);
71
  }
72
  }
73
+
74
+ private function invokeStats(
75
+ array $options,
76
+ RequestInterface $request,
77
+ $startTime,
78
+ ResponseInterface $response = null,
79
+ $error = null
80
+ ) {
81
  if (isset($options['on_stats'])) {
82
+ $stats = new TransferStats(
83
+ $request,
84
+ $response,
85
+ microtime(true) - $startTime,
86
+ $error,
87
+ []
88
+ );
89
+ call_user_func($options['on_stats'], $stats);
90
  }
91
  }
92
+
93
+ private function createResponse(
94
+ RequestInterface $request,
95
+ array $options,
96
+ $stream,
97
+ $startTime
98
+ ) {
99
  $hdrs = $this->lastHeaders;
100
  $this->lastHeaders = [];
101
+ $parts = explode(' ', array_shift($hdrs), 3);
102
+ $ver = explode('/', $parts[0])[1];
103
  $status = $parts[1];
104
  $reason = isset($parts[2]) ? $parts[2] : null;
105
+ $headers = \GuzzleHttp\headers_from_lines($hdrs);
106
  list($stream, $headers) = $this->checkDecode($options, $headers, $stream);
107
+ $stream = Psr7\stream_for($stream);
108
  $sink = $stream;
109
+
110
+ if (strcasecmp('HEAD', $request->getMethod())) {
111
  $sink = $this->createSink($stream, $options);
112
  }
113
+
114
+ $response = new Psr7\Response($status, $headers, $sink, $ver, $reason);
115
+
116
  if (isset($options['on_headers'])) {
117
  try {
118
  $options['on_headers']($response);
119
  } catch (\Exception $e) {
120
  $msg = 'An error was encountered during the on_headers event';
121
+ $ex = new RequestException($msg, $request, $response, $e);
122
+ return \GuzzleHttp\Promise\rejection_for($ex);
123
  }
124
  }
125
+
126
  // Do not drain when the request is a HEAD request because they have
127
  // no body.
128
  if ($sink !== $stream) {
129
+ $this->drain(
130
+ $stream,
131
+ $sink,
132
+ $response->getHeaderLine('Content-Length')
133
+ );
134
  }
135
+
136
  $this->invokeStats($options, $request, $startTime, $response, null);
137
+
138
+ return new FulfilledPromise($response);
139
  }
140
+
141
+ private function createSink(StreamInterface $stream, array $options)
142
  {
143
  if (!empty($options['stream'])) {
144
  return $stream;
145
  }
146
+
147
+ $sink = isset($options['sink'])
148
+ ? $options['sink']
149
+ : fopen('php://temp', 'r+');
150
+
151
+ return is_string($sink)
152
+ ? new Psr7\LazyOpenStream($sink, 'w+')
153
+ : Psr7\stream_for($sink);
154
  }
155
+
156
  private function checkDecode(array $options, array $headers, $stream)
157
  {
158
  // Automatically decode responses when instructed.
159
  if (!empty($options['decode_content'])) {
160
+ $normalizedKeys = \GuzzleHttp\normalize_header_keys($headers);
161
  if (isset($normalizedKeys['content-encoding'])) {
162
  $encoding = $headers[$normalizedKeys['content-encoding']];
163
  if ($encoding[0] === 'gzip' || $encoding[0] === 'deflate') {
164
+ $stream = new Psr7\InflateStream(
165
+ Psr7\stream_for($stream)
166
+ );
167
+ $headers['x-encoded-content-encoding']
168
+ = $headers[$normalizedKeys['content-encoding']];
169
  // Remove content-encoding header
170
  unset($headers[$normalizedKeys['content-encoding']]);
171
  // Fix content-length header
172
  if (isset($normalizedKeys['content-length'])) {
173
+ $headers['x-encoded-content-length']
174
+ = $headers[$normalizedKeys['content-length']];
175
+
176
  $length = (int) $stream->getSize();
177
  if ($length === 0) {
178
  unset($headers[$normalizedKeys['content-length']]);
183
  }
184
  }
185
  }
186
+
187
  return [$stream, $headers];
188
  }
189
+
190
  /**
191
  * Drains the source stream into the "sink" client option.
192
  *
198
  * @return StreamInterface
199
  * @throws \RuntimeException when the sink option is invalid.
200
  */
201
+ private function drain(
202
+ StreamInterface $source,
203
+ StreamInterface $sink,
204
+ $contentLength
205
+ ) {
206
  // If a content-length header is provided, then stop reading once
207
  // that number of bytes has been read. This can prevent infinitely
208
  // reading from a stream when dealing with servers that do not honor
209
  // Connection: Close headers.
210
+ Psr7\copy_to_stream(
211
+ $source,
212
+ $sink,
213
+ (strlen($contentLength) > 0 && (int) $contentLength > 0) ? (int) $contentLength : -1
214
+ );
215
+
216
  $sink->seek(0);
217
  $source->close();
218
+
219
  return $sink;
220
  }
221
+
222
  /**
223
  * Create a resource and check to ensure it was created successfully
224
  *
230
  private function createResource(callable $callback)
231
  {
232
  $errors = null;
233
+ set_error_handler(function ($_, $msg, $file, $line) use (&$errors) {
234
+ $errors[] = [
235
+ 'message' => $msg,
236
+ 'file' => $file,
237
+ 'line' => $line
238
+ ];
239
+ return true;
240
  });
241
+
242
  $resource = $callback();
243
+ restore_error_handler();
244
+
245
  if (!$resource) {
246
  $message = 'Error creating resource: ';
247
  foreach ($errors as $err) {
248
  foreach ($err as $key => $value) {
249
+ $message .= "[$key] $value" . PHP_EOL;
250
  }
251
  }
252
+ throw new \RuntimeException(trim($message));
253
  }
254
+
255
  return $resource;
256
  }
257
+
258
+ private function createStream(RequestInterface $request, array $options)
259
  {
260
  static $methods;
261
  if (!$methods) {
262
+ $methods = array_flip(get_class_methods(__CLASS__));
263
  }
264
+
265
  // HTTP/1.1 streams using the PHP stream wrapper require a
266
  // Connection: close header
267
+ if ($request->getProtocolVersion() == '1.1'
268
+ && !$request->hasHeader('Connection')
269
+ ) {
270
  $request = $request->withHeader('Connection', 'close');
271
  }
272
+
273
  // Ensure SSL is verified by default
274
  if (!isset($options['verify'])) {
275
+ $options['verify'] = true;
276
  }
277
+
278
  $params = [];
279
  $context = $this->getDefaultContext($request);
280
+
281
+ if (isset($options['on_headers']) && !is_callable($options['on_headers'])) {
282
  throw new \InvalidArgumentException('on_headers must be callable');
283
  }
284
+
285
  if (!empty($options)) {
286
  foreach ($options as $key => $value) {
287
  $method = "add_{$key}";
290
  }
291
  }
292
  }
293
+
294
  if (isset($options['stream_context'])) {
295
+ if (!is_array($options['stream_context'])) {
296
  throw new \InvalidArgumentException('stream_context must be an array');
297
  }
298
+ $context = array_replace_recursive(
299
+ $context,
300
+ $options['stream_context']
301
+ );
302
  }
303
+
304
  // Microsoft NTLM authentication only supported with curl handler
305
+ if (isset($options['auth'])
306
+ && is_array($options['auth'])
307
+ && isset($options['auth'][2])
308
+ && 'ntlm' == $options['auth'][2]
309
+ ) {
310
  throw new \InvalidArgumentException('Microsoft NTLM authentication only supported with curl handler');
311
  }
312
+
313
  $uri = $this->resolveHost($request, $options);
314
+
315
+ $context = $this->createResource(
316
+ function () use ($context, $params) {
317
+ return stream_context_create($context, $params);
 
 
 
 
 
 
 
318
  }
319
+ );
320
+
321
+ return $this->createResource(
322
+ function () use ($uri, &$http_response_header, $context, $options) {
323
+ $resource = fopen((string) $uri, 'r', null, $context);
324
+ $this->lastHeaders = $http_response_header;
325
+
326
+ if (isset($options['read_timeout'])) {
327
+ $readTimeout = $options['read_timeout'];
328
+ $sec = (int) $readTimeout;
329
+ $usec = ($readTimeout - $sec) * 100000;
330
+ stream_set_timeout($resource, $sec, $usec);
331
+ }
332
+
333
+ return $resource;
334
+ }
335
+ );
336
  }
337
+
338
+ private function resolveHost(RequestInterface $request, array $options)
339
  {
340
  $uri = $request->getUri();
341
+
342
+ if (isset($options['force_ip_resolve']) && !filter_var($uri->getHost(), FILTER_VALIDATE_IP)) {
343
  if ('v4' === $options['force_ip_resolve']) {
344
+ $records = dns_get_record($uri->getHost(), DNS_A);
345
  if (!isset($records[0]['ip'])) {
346
+ throw new ConnectException(sprintf("Could not resolve IPv4 address for host '%s'", $uri->getHost()), $request);
347
  }
348
  $uri = $uri->withHost($records[0]['ip']);
349
  } elseif ('v6' === $options['force_ip_resolve']) {
350
+ $records = dns_get_record($uri->getHost(), DNS_AAAA);
351
  if (!isset($records[0]['ipv6'])) {
352
+ throw new ConnectException(sprintf("Could not resolve IPv6 address for host '%s'", $uri->getHost()), $request);
353
  }
354
  $uri = $uri->withHost('[' . $records[0]['ipv6'] . ']');
355
  }
356
  }
357
+
358
  return $uri;
359
  }
360
+
361
+ private function getDefaultContext(RequestInterface $request)
362
  {
363
  $headers = '';
364
  foreach ($request->getHeaders() as $name => $value) {
365
  foreach ($value as $val) {
366
+ $headers .= "$name: $val\r\n";
367
  }
368
  }
369
+
370
+ $context = [
371
+ 'http' => [
372
+ 'method' => $request->getMethod(),
373
+ 'header' => $headers,
374
+ 'protocol_version' => $request->getProtocolVersion(),
375
+ 'ignore_errors' => true,
376
+ 'follow_location' => 0,
377
+ ],
378
+ ];
379
+
380
  $body = (string) $request->getBody();
381
+
382
  if (!empty($body)) {
383
  $context['http']['content'] = $body;
384
  // Prevent the HTTP handler from adding a Content-Type header.
386
  $context['http']['header'] .= "Content-Type:\r\n";
387
  }
388
  }
389
+
390
+ $context['http']['header'] = rtrim($context['http']['header']);
391
+
392
  return $context;
393
  }
394
+
395
+ private function add_proxy(RequestInterface $request, &$options, $value, &$params)
396
  {
397
+ if (!is_array($value)) {
398
  $options['http']['proxy'] = $value;
399
  } else {
400
  $scheme = $request->getUri()->getScheme();
401
  if (isset($value[$scheme])) {
402
+ if (!isset($value['no'])
403
+ || !\GuzzleHttp\is_host_in_noproxy(
404
+ $request->getUri()->getHost(),
405
+ $value['no']
406
+ )
407
+ ) {
408
  $options['http']['proxy'] = $value[$scheme];
409
  }
410
  }
411
  }
412
  }
413
+
414
+ private function add_timeout(RequestInterface $request, &$options, $value, &$params)
415
  {
416
  if ($value > 0) {
417
  $options['http']['timeout'] = $value;
418
  }
419
  }
420
+
421
+ private function add_verify(RequestInterface $request, &$options, $value, &$params)
422
  {
423
+ if ($value === true) {
424
  // PHP 5.6 or greater will find the system cert by default. When
425
  // < 5.6, use the Guzzle bundled cacert.
426
+ if (PHP_VERSION_ID < 50600) {
427
+ $options['ssl']['cafile'] = \GuzzleHttp\default_ca_bundle();
428
  }
429
+ } elseif (is_string($value)) {
430
  $options['ssl']['cafile'] = $value;
431
+ if (!file_exists($value)) {
432
+ throw new \RuntimeException("SSL CA bundle not found: $value");
433
  }
434
+ } elseif ($value === false) {
435
+ $options['ssl']['verify_peer'] = false;
436
+ $options['ssl']['verify_peer_name'] = false;
437
  return;
438
  } else {
439
  throw new \InvalidArgumentException('Invalid verify request option');
440
  }
441
+
442
+ $options['ssl']['verify_peer'] = true;
443
+ $options['ssl']['verify_peer_name'] = true;
444
+ $options['ssl']['allow_self_signed'] = false;
445
  }
446
+
447
+ private function add_cert(RequestInterface $request, &$options, $value, &$params)
448
  {
449
+ if (is_array($value)) {
450
  $options['ssl']['passphrase'] = $value[1];
451
  $value = $value[0];
452
  }
453
+
454
+ if (!file_exists($value)) {
455
  throw new \RuntimeException("SSL certificate not found: {$value}");
456
  }
457
+
458
  $options['ssl']['local_cert'] = $value;
459
  }
460
+
461
+ private function add_progress(RequestInterface $request, &$options, $value, &$params)
462
  {
463
+ $this->addNotification(
464
+ $params,
465
+ function ($code, $a, $b, $c, $transferred, $total) use ($value) {
466
+ if ($code == STREAM_NOTIFY_PROGRESS) {
467
+ $value($total, $transferred, null, null);
468
+ }
469
  }
470
+ );
471
  }
472
+
473
+ private function add_debug(RequestInterface $request, &$options, $value, &$params)
474
  {
475
+ if ($value === false) {
476
  return;
477
  }
478
+
479
+ static $map = [
480
+ STREAM_NOTIFY_CONNECT => 'CONNECT',
481
+ STREAM_NOTIFY_AUTH_REQUIRED => 'AUTH_REQUIRED',
482
+ STREAM_NOTIFY_AUTH_RESULT => 'AUTH_RESULT',
483
+ STREAM_NOTIFY_MIME_TYPE_IS => 'MIME_TYPE_IS',
484
+ STREAM_NOTIFY_FILE_SIZE_IS => 'FILE_SIZE_IS',
485
+ STREAM_NOTIFY_REDIRECTED => 'REDIRECTED',
486
+ STREAM_NOTIFY_PROGRESS => 'PROGRESS',
487
+ STREAM_NOTIFY_FAILURE => 'FAILURE',
488
+ STREAM_NOTIFY_COMPLETED => 'COMPLETED',
489
+ STREAM_NOTIFY_RESOLVE => 'RESOLVE',
490
+ ];
491
+ static $args = ['severity', 'message', 'message_code',
492
+ 'bytes_transferred', 'bytes_max'];
493
+
494
+ $value = \GuzzleHttp\debug_resource($value);
495
  $ident = $request->getMethod() . ' ' . $request->getUri()->withFragment('');
496
+ $this->addNotification(
497
+ $params,
498
+ function () use ($ident, $value, $map, $args) {
499
+ $passed = func_get_args();
500
+ $code = array_shift($passed);
501
+ fprintf($value, '<%s> [%s] ', $ident, $map[$code]);
502
+ foreach (array_filter($passed) as $i => $v) {
503
+ fwrite($value, $args[$i] . ': "' . $v . '" ');
504
+ }
505
+ fwrite($value, "\n");
506
  }
507
+ );
 
508
  }
509
+
510
  private function addNotification(array &$params, callable $notify)
511
  {
512
  // Wrap the existing function if needed.
513
  if (!isset($params['notification'])) {
514
  $params['notification'] = $notify;
515
  } else {
516
+ $params['notification'] = $this->callArray([
517
+ $params['notification'],
518
+ $notify
519
+ ]);
520
  }
521
  }
522
+
523
  private function callArray(array $functions)
524
  {
525
+ return function () use ($functions) {
526
+ $args = func_get_args();
527
  foreach ($functions as $fn) {
528
+ call_user_func_array($fn, $args);
529
  }
530
  };
531
  }
includes/mollie-api-php/vendor/guzzlehttp/guzzle/src/HandlerStack.php CHANGED
@@ -1,8 +1,8 @@
1
  <?php
 
2
 
3
- namespace _PhpScoper5b6804f9734c8\GuzzleHttp;
4
 
5
- use _PhpScoper5b6804f9734c8\Psr\Http\Message\RequestInterface;
6
  /**
7
  * Creates a composed Guzzle handler function by stacking middlewares on top of
8
  * an HTTP handler function.
@@ -11,10 +11,13 @@ class HandlerStack
11
  {
12
  /** @var callable */
13
  private $handler;
 
14
  /** @var array */
15
  private $stack = [];
 
16
  /** @var callable|null */
17
  private $cached;
 
18
  /**
19
  * Creates a default handler stack that can be used by clients.
20
  *
@@ -35,12 +38,14 @@ class HandlerStack
35
  public static function create(callable $handler = null)
36
  {
37
  $stack = new self($handler ?: choose_handler());
38
- $stack->push(\_PhpScoper5b6804f9734c8\GuzzleHttp\Middleware::httpErrors(), 'http_errors');
39
- $stack->push(\_PhpScoper5b6804f9734c8\GuzzleHttp\Middleware::redirect(), 'allow_redirects');
40
- $stack->push(\_PhpScoper5b6804f9734c8\GuzzleHttp\Middleware::cookies(), 'cookies');
41
- $stack->push(\_PhpScoper5b6804f9734c8\GuzzleHttp\Middleware::prepareBody(), 'prepare_body');
 
42
  return $stack;
43
  }
 
44
  /**
45
  * @param callable $handler Underlying HTTP handler.
46
  */
@@ -48,17 +53,20 @@ class HandlerStack
48
  {
49
  $this->handler = $handler;
50
  }
 
51
  /**
52
  * Invokes the handler stack as a composed handler
53
  *
54
  * @param RequestInterface $request
55
  * @param array $options
56
  */
57
- public function __invoke(\_PhpScoper5b6804f9734c8\Psr\Http\Message\RequestInterface $request, array $options)
58
  {
59
  $handler = $this->resolve();
 
60
  return $handler($request, $options);
61
  }
 
62
  /**
63
  * Dumps a string representation of the stack.
64
  *
@@ -71,19 +79,23 @@ class HandlerStack
71
  if ($this->handler) {
72
  $stack[] = "0) Handler: " . $this->debugCallable($this->handler);
73
  }
 
74
  $result = '';
75
- foreach (\array_reverse($this->stack) as $tuple) {
76
  $depth++;
77
  $str = "{$depth}) Name: '{$tuple[1]}', ";
78
  $str .= "Function: " . $this->debugCallable($tuple[0]);
79
  $result = "> {$str}\n{$result}";
80
  $stack[] = $str;
81
  }
82
- foreach (\array_keys($stack) as $k) {
 
83
  $result .= "< {$stack[$k]}\n";
84
  }
 
85
  return $result;
86
  }
 
87
  /**
88
  * Set the HTTP handler that actually returns a promise.
89
  *
@@ -95,6 +107,7 @@ class HandlerStack
95
  $this->handler = $handler;
96
  $this->cached = null;
97
  }
 
98
  /**
99
  * Returns true if the builder has a handler.
100
  *
@@ -104,6 +117,7 @@ class HandlerStack
104
  {
105
  return (bool) $this->handler;
106
  }
 
107
  /**
108
  * Unshift a middleware to the bottom of the stack.
109
  *
@@ -112,9 +126,10 @@ class HandlerStack
112
  */
113
  public function unshift(callable $middleware, $name = null)
114
  {
115
- \array_unshift($this->stack, [$middleware, $name]);
116
  $this->cached = null;
117
  }
 
118
  /**
119
  * Push a middleware to the top of the stack.
120
  *
@@ -126,6 +141,7 @@ class HandlerStack
126
  $this->stack[] = [$middleware, $name];
127
  $this->cached = null;
128
  }
 
129
  /**
130
  * Add a middleware before another middleware by name.
131
  *
@@ -135,8 +151,9 @@ class HandlerStack
135
  */
136
  public function before($findName, callable $middleware, $withName = '')
137
  {
138
- $this->splice($findName, $withName, $middleware, \true);
139
  }
 
140
  /**
141
  * Add a middleware after another middleware by name.
142
  *
@@ -146,8 +163,9 @@ class HandlerStack
146
  */
147
  public function after($findName, callable $middleware, $withName = '')
148
  {
149
- $this->splice($findName, $withName, $middleware, \false);
150
  }
 
151
  /**
152
  * Remove a middleware by instance or name from the stack.
153
  *
@@ -156,11 +174,15 @@ class HandlerStack
156
  public function remove($remove)
157
  {
158
  $this->cached = null;
159
- $idx = \is_callable($remove) ? 0 : 1;
160
- $this->stack = \array_values(\array_filter($this->stack, function ($tuple) use($idx, $remove) {
161
- return $tuple[$idx] !== $remove;
162
- }));
 
 
 
163
  }
 
164
  /**
165
  * Compose the middleware and handler into a single callable function.
166
  *
@@ -172,13 +194,17 @@ class HandlerStack
172
  if (!($prev = $this->handler)) {
173
  throw new \LogicException('No handler has been specified');
174
  }
175
- foreach (\array_reverse($this->stack) as $fn) {
 
176
  $prev = $fn[0]($prev);
177
  }
 
178
  $this->cached = $prev;
179
  }
 
180
  return $this->cached;
181
  }
 
182
  /**
183
  * @param $name
184
  * @return int
@@ -190,8 +216,10 @@ class HandlerStack
190
  return $k;
191
  }
192
  }
193
- throw new \InvalidArgumentException("Middleware not found: {$name}");
 
194
  }
 
195
  /**
196
  * Splices a function into the middleware list at a specific position.
197
  *
@@ -205,20 +233,22 @@ class HandlerStack
205
  $this->cached = null;
206
  $idx = $this->findByName($findName);
207
  $tuple = [$middleware, $withName];
 
208
  if ($before) {
209
  if ($idx === 0) {
210
- \array_unshift($this->stack, $tuple);
211
  } else {
212
  $replacement = [$tuple, $this->stack[$idx]];
213
- \array_splice($this->stack, $idx, 1, $replacement);
214
  }
215
- } elseif ($idx === \count($this->stack) - 1) {
216
  $this->stack[] = $tuple;
217
  } else {
218
  $replacement = [$this->stack[$idx], $tuple];
219
- \array_splice($this->stack, $idx, 1, $replacement);
220
  }
221
  }
 
222
  /**
223
  * Provides a debug string for a given callable.
224
  *
@@ -228,12 +258,16 @@ class HandlerStack
228
  */
229
  private function debugCallable($fn)
230
  {
231
- if (\is_string($fn)) {
232
  return "callable({$fn})";
233
  }
234
- if (\is_array($fn)) {
235
- return \is_string($fn[0]) ? "callable({$fn[0]}::{$fn[1]})" : "callable(['" . \get_class($fn[0]) . "', '{$fn[1]}'])";
 
 
 
236
  }
237
- return 'callable(' . \spl_object_hash($fn) . ')';
 
238
  }
239
  }
1
  <?php
2
+ namespace GuzzleHttp;
3
 
4
+ use Psr\Http\Message\RequestInterface;
5
 
 
6
  /**
7
  * Creates a composed Guzzle handler function by stacking middlewares on top of
8
  * an HTTP handler function.
11
  {
12
  /** @var callable */
13
  private $handler;
14
+
15
  /** @var array */
16
  private $stack = [];
17
+
18
  /** @var callable|null */
19
  private $cached;
20
+
21
  /**
22
  * Creates a default handler stack that can be used by clients.
23
  *
38
  public static function create(callable $handler = null)
39
  {
40
  $stack = new self($handler ?: choose_handler());
41
+ $stack->push(Middleware::httpErrors(), 'http_errors');
42
+ $stack->push(Middleware::redirect(), 'allow_redirects');
43
+ $stack->push(Middleware::cookies(), 'cookies');
44
+ $stack->push(Middleware::prepareBody(), 'prepare_body');
45
+
46
  return $stack;
47
  }
48
+
49
  /**
50
  * @param callable $handler Underlying HTTP handler.
51
  */
53
  {
54
  $this->handler = $handler;
55
  }
56
+
57
  /**
58
  * Invokes the handler stack as a composed handler
59
  *
60
  * @param RequestInterface $request
61
  * @param array $options
62
  */
63
+ public function __invoke(RequestInterface $request, array $options)
64
  {
65
  $handler = $this->resolve();
66
+
67
  return $handler($request, $options);
68
  }
69
+
70
  /**
71
  * Dumps a string representation of the stack.
72
  *
79
  if ($this->handler) {
80
  $stack[] = "0) Handler: " . $this->debugCallable($this->handler);
81
  }
82
+
83
  $result = '';
84
+ foreach (array_reverse($this->stack) as $tuple) {
85
  $depth++;
86
  $str = "{$depth}) Name: '{$tuple[1]}', ";
87
  $str .= "Function: " . $this->debugCallable($tuple[0]);
88
  $result = "> {$str}\n{$result}";
89
  $stack[] = $str;
90
  }
91
+
92
+ foreach (array_keys($stack) as $k) {
93
  $result .= "< {$stack[$k]}\n";
94
  }
95
+
96
  return $result;
97
  }
98
+
99
  /**
100
  * Set the HTTP handler that actually returns a promise.
101
  *
107
  $this->handler = $handler;
108
  $this->cached = null;
109
  }
110
+
111
  /**
112
  * Returns true if the builder has a handler.
113
  *
117
  {
118
  return (bool) $this->handler;
119
  }
120
+
121
  /**
122
  * Unshift a middleware to the bottom of the stack.
123
  *
126
  */
127
  public function unshift(callable $middleware, $name = null)
128
  {
129
+ array_unshift($this->stack, [$middleware, $name]);
130
  $this->cached = null;
131
  }
132
+
133
  /**
134
  * Push a middleware to the top of the stack.
135
  *
141
  $this->stack[] = [$middleware, $name];
142
  $this->cached = null;
143
  }
144
+
145
  /**
146
  * Add a middleware before another middleware by name.
147
  *
151
  */
152
  public function before($findName, callable $middleware, $withName = '')
153
  {
154
+ $this->splice($findName, $withName, $middleware, true);
155
  }
156
+
157
  /**
158
  * Add a middleware after another middleware by name.
159
  *
163
  */
164
  public function after($findName, callable $middleware, $withName = '')
165
  {
166
+ $this->splice($findName, $withName, $middleware, false);
167
  }
168
+
169
  /**
170
  * Remove a middleware by instance or name from the stack.
171
  *
174
  public function remove($remove)
175
  {
176
  $this->cached = null;
177
+ $idx = is_callable($remove) ? 0 : 1;
178
+ $this->stack = array_values(array_filter(
179
+ $this->stack,
180
+ function ($tuple) use ($idx, $remove) {
181
+ return $tuple[$idx] !== $remove;
182
+ }
183
+ ));
184
  }
185
+
186
  /**
187
  * Compose the middleware and handler into a single callable function.
188
  *
194
  if (!($prev = $this->handler)) {
195
  throw new \LogicException('No handler has been specified');
196
  }
197
+
198
+ foreach (array_reverse($this->stack) as $fn) {
199
  $prev = $fn[0]($prev);
200
  }
201
+
202
  $this->cached = $prev;
203
  }
204
+
205
  return $this->cached;
206
  }
207
+
208
  /**
209
  * @param $name
210
  * @return int
216
  return $k;
217
  }
218
  }
219
+
220
+ throw new \InvalidArgumentException("Middleware not found: $name");
221
  }
222
+
223
  /**
224
  * Splices a function into the middleware list at a specific position.
225
  *
233
  $this->cached = null;
234
  $idx = $this->findByName($findName);
235
  $tuple = [$middleware, $withName];
236
+
237
  if ($before) {
238
  if ($idx === 0) {
239
+ array_unshift($this->stack, $tuple);
240
  } else {
241
  $replacement = [$tuple, $this->stack[$idx]];
242
+ array_splice($this->stack, $idx, 1, $replacement);
243
  }
244
+ } elseif ($idx === count($this->stack) - 1) {
245
  $this->stack[] = $tuple;
246
  } else {
247
  $replacement = [$this->stack[$idx], $tuple];
248
+ array_splice($this->stack, $idx, 1, $replacement);
249
  }
250
  }
251
+
252
  /**
253
  * Provides a debug string for a given callable.
254
  *
258
  */
259
  private function debugCallable($fn)
260
  {
261
+ if (is_string($fn)) {
262
  return "callable({$fn})";
263
  }
264
+
265
+ if (is_array($fn)) {
266
+ return is_string($fn[0])
267
+ ? "callable({$fn[0]}::{$fn[1]})"
268
+ : "callable(['" . get_class($fn[0]) . "', '{$fn[1]}'])";
269
  }
270
+
271
+ return 'callable(' . spl_object_hash($fn) . ')';
272
  }
273
  }
includes/mollie-api-php/vendor/guzzlehttp/guzzle/src/MessageFormatter.php CHANGED
@@ -1,10 +1,10 @@
1
  <?php
 
2
 
3
- namespace _PhpScoper5b6804f9734c8\GuzzleHttp;
 
 
4
 
5
- use _PhpScoper5b6804f9734c8\Psr\Http\Message\MessageInterface;
6
- use _PhpScoper5b6804f9734c8\Psr\Http\Message\RequestInterface;
7
- use _PhpScoper5b6804f9734c8\Psr\Http\Message\ResponseInterface;
8
  /**
9
  * Formats log messages using variable substitutions for requests, responses,
10
  * and other transactional data.
@@ -42,8 +42,10 @@ class MessageFormatter
42
  const CLF = "{hostname} {req_header_User-Agent} - [{date_common_log}] \"{method} {target} HTTP/{version}\" {code} {res_header_Content-Length}";
43
  const DEBUG = ">>>>>>>>\n{request}\n<<<<<<<<\n{response}\n--------\n{error}";
44
  const SHORT = '[{ts}] "{method} {target} HTTP/{version}" {code}';
 
45
  /** @var string Template used to format log messages */
46
  private $template;
 
47
  /**
48
  * @param string $template Log message template
49
  */
@@ -51,6 +53,7 @@ class MessageFormatter
51
  {
52
  $this->template = $template ?: self::CLF;
53
  }
 
54
  /**
55
  * Returns a formatted message string.
56
  *
@@ -60,92 +63,118 @@ class MessageFormatter
60
  *
61
  * @return string
62
  */
63
- public function format(\_PhpScoper5b6804f9734c8\Psr\Http\Message\RequestInterface $request, \_PhpScoper5b6804f9734c8\Psr\Http\Message\ResponseInterface $response = null, \Exception $error = null)
64
- {
 
 
 
65
  $cache = [];
66
- return \preg_replace_callback('/{\\s*([A-Za-z_\\-\\.0-9]+)\\s*}/', function (array $matches) use($request, $response, $error, &$cache) {
67
- if (isset($cache[$matches[1]])) {
68
- return $cache[$matches[1]];
69
- }
70
- $result = '';
71
- switch ($matches[1]) {
72
- case 'request':
73
- $result = \_PhpScoper5b6804f9734c8\GuzzleHttp\Psr7\str($request);
74
- break;
75
- case 'response':
76
- $result = $response ? \_PhpScoper5b6804f9734c8\GuzzleHttp\Psr7\str($response) : '';
77
- break;
78
- case 'req_headers':
79
- $result = \trim($request->getMethod() . ' ' . $request->getRequestTarget()) . ' HTTP/' . $request->getProtocolVersion() . "\r\n" . $this->headers($request);
80
- break;
81
- case 'res_headers':
82
- $result = $response ? \sprintf('HTTP/%s %d %s', $response->getProtocolVersion(), $response->getStatusCode(), $response->getReasonPhrase()) . "\r\n" . $this->headers($response) : 'NULL';
83
- break;
84
- case 'req_body':
85
- $result = $request->getBody();
86
- break;
87
- case 'res_body':
88
- $result = $response ? $response->getBody() : 'NULL';
89
- break;
90
- case 'ts':
91
- case 'date_iso_8601':
92
- $result = \gmdate('c');
93
- break;
94
- case 'date_common_log':
95
- $result = \date('d/M/Y:H:i:s O');
96
- break;
97
- case 'method':
98
- $result = $request->getMethod();
99
- break;
100
- case 'version':
101
- $result = $request->getProtocolVersion();
102
- break;
103
- case 'uri':
104
- case 'url':
105
- $result = $request->getUri();
106
- break;
107
- case 'target':
108
- $result = $request->getRequestTarget();
109
- break;
110
- case 'req_version':
111
- $result = $request->getProtocolVersion();
112
- break;
113
- case 'res_version':
114
- $result = $response ? $response->getProtocolVersion() : 'NULL';
115
- break;
116
- case 'host':
117
- $result = $request->getHeaderLine('Host');
118
- break;
119
- case 'hostname':
120
- $result = \gethostname();
121
- break;
122
- case 'code':
123
- $result = $response ? $response->getStatusCode() : 'NULL';
124
- break;
125
- case 'phrase':
126
- $result = $response ? $response->getReasonPhrase() : 'NULL';
127
- break;
128
- case 'error':
129
- $result = $error ? $error->getMessage() : 'NULL';
130
- break;
131
- default:
132
- // handle prefixed dynamic headers
133
- if (\strpos($matches[1], 'req_header_') === 0) {
134
- $result = $request->getHeaderLine(\substr($matches[1], 11));
135
- } elseif (\strpos($matches[1], 'res_header_') === 0) {
136
- $result = $response ? $response->getHeaderLine(\substr($matches[1], 11)) : 'NULL';
137
- }
138
- }
139
- $cache[$matches[1]] = $result;
140
- return $result;
141
- }, $this->template);
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
142
  }
143
- private function headers(\_PhpScoper5b6804f9734c8\Psr\Http\Message\MessageInterface $message)
 
144
  {
145
  $result = '';
146
  foreach ($message->getHeaders() as $name => $values) {
147
- $result .= $name . ': ' . \implode(', ', $values) . "\r\n";
148
  }
149
- return \trim($result);
 
150
  }
151
  }
1
  <?php
2
+ namespace GuzzleHttp;
3
 
4
+ use Psr\Http\Message\MessageInterface;
5
+ use Psr\Http\Message\RequestInterface;
6
+ use Psr\Http\Message\ResponseInterface;
7
 
 
 
 
8
  /**
9
  * Formats log messages using variable substitutions for requests, responses,
10
  * and other transactional data.
42
  const CLF = "{hostname} {req_header_User-Agent} - [{date_common_log}] \"{method} {target} HTTP/{version}\" {code} {res_header_Content-Length}";
43
  const DEBUG = ">>>>>>>>\n{request}\n<<<<<<<<\n{response}\n--------\n{error}";
44
  const SHORT = '[{ts}] "{method} {target} HTTP/{version}" {code}';
45
+
46
  /** @var string Template used to format log messages */
47
  private $template;
48
+
49
  /**
50
  * @param string $template Log message template
51
  */
53
  {
54
  $this->template = $template ?: self::CLF;
55
  }
56
+
57
  /**
58
  * Returns a formatted message string.
59
  *
63
  *
64
  * @return string
65
  */
66
+ public function format(
67
+ RequestInterface $request,
68
+ ResponseInterface $response = null,
69
+ \Exception $error = null
70
+ ) {
71
  $cache = [];
72
+
73
+ return preg_replace_callback(
74
+ '/{\s*([A-Za-z_\-\.0-9]+)\s*}/',
75
+ function (array $matches) use ($request, $response, $error, &$cache) {
76
+ if (isset($cache[$matches[1]])) {
77
+ return $cache[$matches[1]];
78
+ }
79
+
80
+ $result = '';
81
+ switch ($matches[1]) {
82
+ case 'request':
83
+ $result = Psr7\str($request);
84
+ break;
85
+ case 'response':
86
+ $result = $response ? Psr7\str($response) : '';
87
+ break;
88
+ case 'req_headers':
89
+ $result = trim($request->getMethod()
90
+ . ' ' . $request->getRequestTarget())
91
+ . ' HTTP/' . $request->getProtocolVersion() . "\r\n"
92
+ . $this->headers($request);
93
+ break;
94
+ case 'res_headers':
95
+ $result = $response ?
96
+ sprintf(
97
+ 'HTTP/%s %d %s',
98
+ $response->getProtocolVersion(),
99
+ $response->getStatusCode(),
100
+ $response->getReasonPhrase()
101
+ ) . "\r\n" . $this->headers($response)
102
+ : 'NULL';
103
+ break;
104
+ case 'req_body':
105
+ $result = $request->getBody();
106
+ break;
107
+ case 'res_body':
108
+ $result = $response ? $response->getBody() : 'NULL';
109
+ break;
110
+ case 'ts':
111
+ case 'date_iso_8601':
112
+ $result = gmdate('c');
113
+ break;
114
+ case 'date_common_log':
115
+ $result = date('d/M/Y:H:i:s O');
116
+ break;
117
+ case 'method':
118
+ $result = $request->getMethod();
119
+ break;
120
+ case 'version':
121
+ $result = $request->getProtocolVersion();
122
+ break;
123
+ case 'uri':
124
+ case 'url':
125
+ $result = $request->getUri();
126
+ break;
127
+ case 'target':
128
+ $result = $request->getRequestTarget();
129
+ break;
130
+ case 'req_version':
131
+ $result = $request->getProtocolVersion();
132
+ break;
133
+ case 'res_version':
134
+ $result = $response
135
+ ? $response->getProtocolVersion()
136
+ : 'NULL';
137
+ break;
138
+ case 'host':
139
+ $result = $request->getHeaderLine('Host');
140
+ break;
141
+ case 'hostname':
142
+ $result = gethostname();
143
+ break;
144
+ case 'code':
145
+ $result = $response ? $response->getStatusCode() : 'NULL';
146
+ break;
147
+ case 'phrase':
148
+ $result = $response ? $response->getReasonPhrase() : 'NULL';
149
+ break;
150
+ case 'error':
151
+ $result = $error ? $error->getMessage() : 'NULL';
152
+ break;
153
+ default:
154
+ // handle prefixed dynamic headers
155
+ if (strpos($matches[1], 'req_header_') === 0) {
156
+ $result = $request->getHeaderLine(substr($matches[1], 11));
157
+ } elseif (strpos($matches[1], 'res_header_') === 0) {
158
+ $result = $response
159
+ ? $response->getHeaderLine(substr($matches[1], 11))
160
+ : 'NULL';
161
+ }
162
+ }
163
+
164
+ $cache[$matches[1]] = $result;
165
+ return $result;
166
+ },
167
+ $this->template
168
+ );
169
  }
170
+
171
+ private function headers(MessageInterface $message)
172
  {
173
  $result = '';
174
  foreach ($message->getHeaders() as $name => $values) {
175
+ $result .= $name . ': ' . implode(', ', $values) . "\r\n";
176
  }
177
+
178
+ return trim($result);
179
  }
180
  }
includes/mollie-api-php/vendor/guzzlehttp/guzzle/src/Middleware.php CHANGED
@@ -1,14 +1,14 @@
1
  <?php
 
2
 
3
- namespace _PhpScoper5b6804f9734c8\GuzzleHttp;
 
 
 
 
 
 
4
 
5
- use _PhpScoper5b6804f9734c8\GuzzleHttp\Cookie\CookieJarInterface;
6
- use _PhpScoper5b6804f9734c8\GuzzleHttp\Exception\RequestException;
7
- use _PhpScoper5b6804f9734c8\GuzzleHttp\Promise\RejectedPromise;
8
- use _PhpScoper5b6804f9734c8\GuzzleHttp\Psr7;
9
- use _PhpScoper5b6804f9734c8\Psr\Http\Message\ResponseInterface;
10
- use _PhpScoper5b6804f9734c8\Psr\Log\LoggerInterface;
11
- use _PhpScoper5b6804f9734c8\Psr\Log\LogLevel;
12
  /**
13
  * Functions used to create and wrap handlers with handler middleware.
14
  */
@@ -25,21 +25,25 @@ final class Middleware
25
  public static function cookies()
26
  {
27
  return function (callable $handler) {
28
- return function ($request, array $options) use($handler) {
29
  if (empty($options['cookies'])) {
30
  return $handler($request, $options);
31
- } elseif (!$options['cookies'] instanceof \_PhpScoper5b6804f9734c8\GuzzleHttp\Cookie\CookieJarInterface) {
32
- throw new \InvalidArgumentException('_PhpScoper5b6804f9734c8\\cookies must be an instance of GuzzleHttp\\Cookie\\CookieJarInterface');
33
  }
34
  $cookieJar = $options['cookies'];
35
  $request = $cookieJar->withCookieHeader($request);
36
- return $handler($request, $options)->then(function ($response) use($cookieJar, $request) {
37
- $cookieJar->extractCookies($request, $response);
38
- return $response;
39
- });
 
 
 
40
  };
41
  };
42
  }
 
43
  /**
44
  * Middleware that throws exceptions for 4xx or 5xx responses when the
45
  * "http_error" request option is set to true.
@@ -49,20 +53,23 @@ final class Middleware
49
  public static function httpErrors()
50
  {
51
  return function (callable $handler) {
52
- return function ($request, array $options) use($handler) {
53
  if (empty($options['http_errors'])) {
54
  return $handler($request, $options);
55
  }
56
- return $handler($request, $options)->then(function (\_PhpScoper5b6804f9734c8\Psr\Http\Message\ResponseInterface $response) use($request, $handler) {
57
- $code = $response->getStatusCode();
58
- if ($code < 400) {
59
- return $response;
 
 
 
60
  }
61
- throw \_PhpScoper5b6804f9734c8\GuzzleHttp\Exception\RequestException::create($request, $response);
62
- });
63
  };
64
  };
65
  }
 
66
  /**
67
  * Middleware that pushes history data to an ArrayAccess container.
68
  *
@@ -73,21 +80,36 @@ final class Middleware
73
  */
74
  public static function history(&$container)
75
  {
76
- if (!\is_array($container) && !$container instanceof \ArrayAccess) {
77
  throw new \InvalidArgumentException('history container must be an array or object implementing ArrayAccess');
78
  }
79
- return function (callable $handler) use(&$container) {
80
- return function ($request, array $options) use($handler, &$container) {
81
- return $handler($request, $options)->then(function ($value) use($request, &$container, $options) {
82
- $container[] = ['request' => $request, 'response' => $value, 'error' => null, 'options' => $options];
83
- return $value;
84
- }, function ($reason) use($request, &$container, $options) {
85
- $container[] = ['request' => $request, 'response' => null, 'error' => $reason, 'options' => $options];
86
- return \_PhpScoper5b6804f9734c8\GuzzleHttp\Promise\rejection_for($reason);
87
- });
 
 
 
 
 
 
 
 
 
 
 
 
 
 
88
  };
89
  };
90
  }
 
91
  /**
92
  * Middleware that invokes a callback before and after sending a request.
93
  *
@@ -103,8 +125,8 @@ final class Middleware
103
  */
104
  public static function tap(callable $before = null, callable $after = null)
105
  {
106
- return function (callable $handler) use($before, $after) {
107
- return function ($request, array $options) use($handler, $before, $after) {
108
  if ($before) {
109
  $before($request, $options);
110
  }
@@ -116,6 +138,7 @@ final class Middleware
116
  };
117
  };
118
  }
 
119
  /**
120
  * Middleware that handles request redirects.
121
  *
@@ -124,9 +147,10 @@ final class Middleware
124
  public static function redirect()
125
  {
126
  return function (callable $handler) {
127
- return new \_PhpScoper5b6804f9734c8\GuzzleHttp\RedirectMiddleware($handler);
128
  };
129
  }
 
130
  /**
131
  * Middleware that retries requests based on the boolean result of
132
  * invoking the provided "decider" function.
@@ -144,10 +168,11 @@ final class Middleware
144
  */
145
  public static function retry(callable $decider, callable $delay = null)
146
  {
147
- return function (callable $handler) use($decider, $delay) {
148
- return new \_PhpScoper5b6804f9734c8\GuzzleHttp\RetryMiddleware($decider, $handler, $delay);
149
  };
150
  }
 
151
  /**
152
  * Middleware that logs requests, responses, and errors using a message
153
  * formatter.
@@ -158,23 +183,29 @@ final class Middleware
158
  *
159
  * @return callable Returns a function that accepts the next handler.
160
  */
161
- public static function log(\_PhpScoper5b6804f9734c8\Psr\Log\LoggerInterface $logger, \_PhpScoper5b6804f9734c8\GuzzleHttp\MessageFormatter $formatter, $logLevel = \_PhpScoper5b6804f9734c8\Psr\Log\LogLevel::INFO)
162
  {
163
- return function (callable $handler) use($logger, $formatter, $logLevel) {
164
- return function ($request, array $options) use($handler, $logger, $formatter, $logLevel) {
165
- return $handler($request, $options)->then(function ($response) use($logger, $request, $formatter, $logLevel) {
166
- $message = $formatter->format($request, $response);
167
- $logger->log($logLevel, $message);
168
- return $response;
169
- }, function ($reason) use($logger, $request, $formatter) {
170
- $response = $reason instanceof \_PhpScoper5b6804f9734c8\GuzzleHttp\Exception\RequestException ? $reason->getResponse() : null;
171
- $message = $formatter->format($request, $response, $reason);
172
- $logger->notice($message);
173
- return \_PhpScoper5b6804f9734c8\GuzzleHttp\Promise\rejection_for($reason);
174
- });
 
 
 
 
 
175
  };
176
  };
177
  }
 
178
  /**
179
  * This middleware adds a default content-type if possible, a default
180
  * content-length or transfer-encoding header, and the expect header.
@@ -184,9 +215,10 @@ final class Middleware
184
  public static function prepareBody()
185
  {
186
  return function (callable $handler) {
187
- return new \_PhpScoper5b6804f9734c8\GuzzleHttp\PrepareBodyMiddleware($handler);
188
  };
189
  }
 
190
  /**
191
  * Middleware that applies a map function to the request before passing to
192
  * the next handler.
@@ -197,12 +229,13 @@ final class Middleware
197
  */
198
  public static function mapRequest(callable $fn)
199
  {
200
- return function (callable $handler) use($fn) {
201
- return function ($request, array $options) use($handler, $fn) {
202
  return $handler($fn($request), $options);
203
  };
204
  };
205
  }
 
206
  /**
207
  * Middleware that applies a map function to the resolved promise's
208
  * response.
@@ -213,8 +246,8 @@ final class Middleware
213
  */
214
  public static function mapResponse(callable $fn)
215
  {
216
- return function (callable $handler) use($fn) {
217
- return function ($request, array $options) use($handler, $fn) {
218
  return $handler($request, $options)->then($fn);
219
  };
220
  };
1
  <?php
2
+ namespace GuzzleHttp;
3
 
4
+ use GuzzleHttp\Cookie\CookieJarInterface;
5
+ use GuzzleHttp\Exception\RequestException;
6
+ use GuzzleHttp\Promise\RejectedPromise;
7
+ use GuzzleHttp\Psr7;
8
+ use Psr\Http\Message\ResponseInterface;
9
+ use Psr\Log\LoggerInterface;
10
+ use Psr\Log\LogLevel;
11
 
 
 
 
 
 
 
 
12
  /**
13
  * Functions used to create and wrap handlers with handler middleware.
14
  */
25
  public static function cookies()
26
  {
27
  return function (callable $handler) {
28
+ return function ($request, array $options) use ($handler) {
29
  if (empty($options['cookies'])) {
30
  return $handler($request, $options);
31
+ } elseif (!($options['cookies'] instanceof CookieJarInterface)) {
32
+ throw new \InvalidArgumentException('cookies must be an instance of GuzzleHttp\Cookie\CookieJarInterface');
33
  }
34
  $cookieJar = $options['cookies'];
35
  $request = $cookieJar->withCookieHeader($request);
36
+ return $handler($request, $options)
37
+ ->then(
38
+ function ($response) use ($cookieJar, $request) {
39
+ $cookieJar->extractCookies($request, $response);
40
+ return $response;
41
+ }
42
+ );
43
  };
44
  };
45
  }
46
+
47
  /**
48
  * Middleware that throws exceptions for 4xx or 5xx responses when the
49
  * "http_error" request option is set to true.
53
  public static function httpErrors()
54
  {
55
  return function (callable $handler) {
56
+ return function ($request, array $options) use ($handler) {
57
  if (empty($options['http_errors'])) {
58
  return $handler($request, $options);
59
  }
60
+ return $handler($request, $options)->then(
61
+ function (ResponseInterface $response) use ($request, $handler) {
62
+ $code = $response->getStatusCode();
63
+ if ($code < 400) {
64
+ return $response;
65
+ }
66
+ throw RequestException::create($request, $response);
67
  }
68
+ );
 
69
  };
70
  };
71
  }
72
+
73
  /**
74
  * Middleware that pushes history data to an ArrayAccess container.
75
  *
80
  */
81
  public static function history(&$container)
82
  {
83
+ if (!is_array($container) && !$container instanceof \ArrayAccess) {
84
  throw new \InvalidArgumentException('history container must be an array or object implementing ArrayAccess');
85
  }
86
+
87
+ return function (callable $handler) use (&$container) {
88
+ return function ($request, array $options) use ($handler, &$container) {
89
+ return $handler($request, $options)->then(
90
+ function ($value) use ($request, &$container, $options) {
91
+ $container[] = [
92
+ 'request' => $request,
93
+ 'response' => $value,
94
+ 'error' => null,
95
+ 'options' => $options
96
+ ];
97
+ return $value;
98
+ },
99
+ function ($reason) use ($request, &$container, $options) {
100
+ $container[] = [
101
+ 'request' => $request,
102
+ 'response' => null,
103
+ 'error' => $reason,
104
+ 'options' => $options
105
+ ];
106
+ return \GuzzleHttp\Promise\rejection_for($reason);
107
+ }
108
+ );
109
  };
110
  };
111
  }
112
+
113
  /**
114
  * Middleware that invokes a callback before and after sending a request.
115
  *
125
  */
126
  public static function tap(callable $before = null, callable $after = null)
127
  {
128
+ return function (callable $handler) use ($before, $after) {
129
+ return function ($request, array $options) use ($handler, $before, $after) {
130
  if ($before) {
131
  $before($request, $options);
132
  }
138
  };
139
  };
140
  }
141
+
142
  /**
143
  * Middleware that handles request redirects.
144
  *
147
  public static function redirect()
148
  {
149
  return function (callable $handler) {
150
+ return new RedirectMiddleware($handler);
151
  };
152
  }
153
+
154
  /**
155
  * Middleware that retries requests based on the boolean result of
156
  * invoking the provided "decider" function.
168
  */
169
  public static function retry(callable $decider, callable $delay = null)
170
  {
171
+ return function (callable $handler) use ($decider, $delay) {
172
+ return new RetryMiddleware($decider, $handler, $delay);
173
  };
174
  }
175
+
176
  /**
177
  * Middleware that logs requests, responses, and errors using a message
178
  * formatter.
183
  *
184
  * @return callable Returns a function that accepts the next handler.
185
  */
186
+ public static function log(LoggerInterface $logger, MessageFormatter $formatter, $logLevel = LogLevel::INFO)
187
  {
188
+ return function (callable $handler) use ($logger, $formatter, $logLevel) {
189
+ return function ($request, array $options) use ($handler, $logger, $formatter, $logLevel) {
190
+ return $handler($request, $options)->then(
191
+ function ($response) use ($logger, $request, $formatter, $logLevel) {
192
+ $message = $formatter->format($request, $response);
193
+ $logger->log($logLevel, $message);
194
+ return $response;
195
+ },
196
+ function ($reason) use ($logger, $request, $formatter) {
197
+ $response = $reason instanceof RequestException
198
+ ? $reason->getResponse()
199
+ : null;
200
+ $message = $formatter->format($request, $response, $reason);
201
+ $logger->notice($message);
202
+ return \GuzzleHttp\Promise\rejection_for($reason);
203
+ }
204
+ );
205
  };
206
  };
207
  }
208
+
209
  /**
210
  * This middleware adds a default content-type if possible, a default
211
  * content-length or transfer-encoding header, and the expect header.
215
  public static function prepareBody()
216
  {
217
  return function (callable $handler) {
218
+ return new PrepareBodyMiddleware($handler);
219
  };
220
  }
221
+
222
  /**
223
  * Middleware that applies a map function to the request before passing to
224
  * the next handler.
229
  */
230
  public static function mapRequest(callable $fn)
231
  {
232
+ return function (callable $handler) use ($fn) {
233
+ return function ($request, array $options) use ($handler, $fn) {
234
  return $handler($fn($request), $options);
235
  };
236
  };
237
  }
238
+
239
  /**
240
  * Middleware that applies a map function to the resolved promise's
241
  * response.
246
  */
247
  public static function mapResponse(callable $fn)
248
  {
249
+ return function (callable $handler) use ($fn) {
250
+ return function ($request, array $options) use ($handler, $fn) {
251
  return $handler($request, $options)->then($fn);
252
  };
253
  };
includes/mollie-api-php/vendor/guzzlehttp/guzzle/src/Pool.php CHANGED
@@ -1,10 +1,10 @@
1
  <?php
 
2
 
3
- namespace _PhpScoper5b6804f9734c8\GuzzleHttp;
 
 
4
 
5
- use _PhpScoper5b6804f9734c8\GuzzleHttp\Promise\PromisorInterface;
6
- use _PhpScoper5b6804f9734c8\Psr\Http\Message\RequestInterface;
7
- use _PhpScoper5b6804f9734c8\GuzzleHttp\Promise\EachPromise;
8
  /**
9
  * Sends and iterator of requests concurrently using a capped pool size.
10
  *
@@ -16,10 +16,11 @@ use _PhpScoper5b6804f9734c8\GuzzleHttp\Promise\EachPromise;
16
  * "request_options" array that should be merged on top of any existing
17
  * options, and the function MUST then return a wait-able promise.
18
  */
19
- class Pool implements \_PhpScoper5b6804f9734c8\GuzzleHttp\Promise\PromisorInterface
20
  {
21
  /** @var EachPromise */
22
  private $each;
 
23
  /**
24
  * @param ClientInterface $client Client used to send the requests.
25
  * @param array|\Iterator $requests Requests or functions that return
@@ -30,38 +31,49 @@ class Pool implements \_PhpScoper5b6804f9734c8\GuzzleHttp\Promise\PromisorInterf
30
  * - fulfilled: (callable) Function to invoke when a request completes.
31
  * - rejected: (callable) Function to invoke when a request is rejected.
32
  */
33
- public function __construct(\_PhpScoper5b6804f9734c8\GuzzleHttp\ClientInterface $client, $requests, array $config = [])
34
- {
 
 
 
35
  // Backwards compatibility.
36
  if (isset($config['pool_size'])) {
37
  $config['concurrency'] = $config['pool_size'];
38
  } elseif (!isset($config['concurrency'])) {
39
  $config['concurrency'] = 25;
40
  }
 
41
  if (isset($config['options'])) {
42
  $opts = $config['options'];
43
  unset($config['options']);
44
  } else {
45
  $opts = [];
46
  }
47
- $iterable = \_PhpScoper5b6804f9734c8\GuzzleHttp\Promise\iter_for($requests);
48
- $requests = function () use($iterable, $client, $opts) {
 
49
  foreach ($iterable as $key => $rfn) {
50
- if ($rfn instanceof \_PhpScoper5b6804f9734c8\Psr\Http\Message\RequestInterface) {
51
- (yield $key => $client->sendAsync($rfn, $opts));
52
- } elseif (\is_callable($rfn)) {
53
- (yield $key => $rfn($opts));
54
  } else {
55
- throw new \InvalidArgumentException('Each value yielded by ' . 'the iterator must be a Psr7\\Http\\Message\\RequestInterface ' . 'or a callable that returns a promise that fulfills ' . 'with a Psr7\\Message\\Http\\ResponseInterface object.');
 
 
 
56
  }
57
  }
58
  };
59
- $this->each = new \_PhpScoper5b6804f9734c8\GuzzleHttp\Promise\EachPromise($requests(), $config);
 
60
  }
 
61
  public function promise()
62
  {
63
  return $this->each->promise();
64
  }
 
65
  /**
66
  * Sends multiple requests concurrently and returns an array of responses
67
  * and exceptions that uses the same ordering as the provided requests.
@@ -79,25 +91,30 @@ class Pool implements \_PhpScoper5b6804f9734c8\GuzzleHttp\Promise\PromisorInterf
79
  * in the same order that the requests were sent.
80
  * @throws \InvalidArgumentException if the event format is incorrect.
81
  */
82
- public static function batch(\_PhpScoper5b6804f9734c8\GuzzleHttp\ClientInterface $client, $requests, array $options = [])
83
- {
 
 
 
84
  $res = [];
85
  self::cmpCallback($options, 'fulfilled', $res);
86
  self::cmpCallback($options, 'rejected', $res);
87
  $pool = new static($client, $requests, $options);
88
  $pool->promise()->wait();
89
- \ksort($res);
 
90
  return $res;
91
  }
 
92
  private static function cmpCallback(array &$options, $name, array &$results)
93
  {
94
  if (!isset($options[$name])) {
95
- $options[$name] = function ($v, $k) use(&$results) {
96
  $results[$k] = $v;
97
  };
98
  } else {
99
  $currentFn = $options[$name];
100
- $options[$name] = function ($v, $k) use(&$results, $currentFn) {
101
  $currentFn($v, $k);
102
  $results[$k] = $v;
103
  };
1
  <?php
2
+ namespace GuzzleHttp;
3
 
4
+ use GuzzleHttp\Promise\PromisorInterface;
5
+ use Psr\Http\Message\RequestInterface;
6
+ use GuzzleHttp\Promise\EachPromise;
7
 
 
 
 
8
  /**
9
  * Sends and iterator of requests concurrently using a capped pool size.
10
  *
16
  * "request_options" array that should be merged on top of any existing
17
  * options, and the function MUST then return a wait-able promise.
18
  */
19
+ class Pool implements PromisorInterface
20
  {
21
  /** @var EachPromise */
22
  private $each;
23
+
24
  /**
25
  * @param ClientInterface $client Client used to send the requests.
26
  * @param array|\Iterator $requests Requests or functions that return
31
  * - fulfilled: (callable) Function to invoke when a request completes.
32
  * - rejected: (callable) Function to invoke when a request is rejected.
33
  */
34
+ public function __construct(
35
+ ClientInterface $client,
36
+ $requests,
37
+ array $config = []
38
+ ) {
39
  // Backwards compatibility.
40
  if (isset($config['pool_size'])) {
41
  $config['concurrency'] = $config['pool_size'];
42
  } elseif (!isset($config['concurrency'])) {
43
  $config['concurrency'] = 25;
44
  }
45
+
46
  if (isset($config['options'])) {
47
  $opts = $config['options'];
48
  unset($config['options']);
49
  } else {
50
  $opts = [];
51
  }
52
+
53
+ $iterable = \GuzzleHttp\Promise\iter_for($requests);
54
+ $requests = function () use ($iterable, $client, $opts) {
55
  foreach ($iterable as $key => $rfn) {
56
+ if ($rfn instanceof RequestInterface) {
57
+ yield $key => $client->sendAsync($rfn, $opts);
58
+ } elseif (is_callable($rfn)) {
59
+ yield $key => $rfn($opts);
60
  } else {
61
+ throw new \InvalidArgumentException('Each value yielded by '
62
+ . 'the iterator must be a Psr7\Http\Message\RequestInterface '
63
+ . 'or a callable that returns a promise that fulfills '
64
+ . 'with a Psr7\Message\Http\ResponseInterface object.');
65
  }
66
  }
67
  };
68
+
69
+ $this->each = new EachPromise($requests(), $config);
70
  }
71
+
72
  public function promise()
73
  {
74
  return $this->each->promise();
75
  }
76
+
77
  /**
78
  * Sends multiple requests concurrently and returns an array of responses
79
  * and exceptions that uses the same ordering as the provided requests.
91
  * in the same order that the requests were sent.
92
  * @throws \InvalidArgumentException if the event format is incorrect.
93
  */
94
+ public static function batch(
95
+ ClientInterface $client,
96
+ $requests,
97
+ array $options = []
98
+ ) {
99
  $res = [];
100
  self::cmpCallback($options, 'fulfilled', $res);
101
  self::cmpCallback($options, 'rejected', $res);
102
  $pool = new static($client, $requests, $options);
103
  $pool->promise()->wait();
104
+ ksort($res);
105
+
106
  return $res;
107
  }
108
+
109
  private static function cmpCallback(array &$options, $name, array &$results)
110
  {
111
  if (!isset($options[$name])) {
112
+ $options[$name] = function ($v, $k) use (&$results) {
113
  $results[$k] = $v;
114
  };
115
  } else {
116
  $currentFn = $options[$name];
117
+ $options[$name] = function ($v, $k) use (&$results, $currentFn) {
118
  $currentFn($v, $k);
119
  $results[$k] = $v;
120
  };
includes/mollie-api-php/vendor/guzzlehttp/guzzle/src/PrepareBodyMiddleware.php CHANGED
@@ -1,10 +1,10 @@
1
  <?php
 
2
 
3
- namespace _PhpScoper5b6804f9734c8\GuzzleHttp;
 
 
4
 
5
- use _PhpScoper5b6804f9734c8\GuzzleHttp\Promise\PromiseInterface;
6
- use _PhpScoper5b6804f9734c8\GuzzleHttp\Psr7;
7
- use _PhpScoper5b6804f9734c8\Psr\Http\Message\RequestInterface;
8
  /**
9
  * Prepares requests that contain a body, adding the Content-Length,
10
  * Content-Type, and Expect headers.
@@ -13,6 +13,7 @@ class PrepareBodyMiddleware
13
  {
14
  /** @var callable */
15
  private $nextHandler;
 
16
  /**
17
  * @param callable $nextHandler Next handler to invoke.
18
  */
@@ -20,30 +21,37 @@ class PrepareBodyMiddleware
20
  {
21
  $this->nextHandler = $nextHandler;
22
  }
 
23
  /**
24
  * @param RequestInterface $request
25
  * @param array $options
26
  *
27
  * @return PromiseInterface
28
  */
29
- public function __invoke(\_PhpScoper5b6804f9734c8\Psr\Http\Message\RequestInterface $request, array $options)
30
  {
31
  $fn = $this->nextHandler;
 
32
  // Don't do anything if the request has no body.
33
  if ($request->getBody()->getSize() === 0) {
34
  return $fn($request, $options);
35
  }
 
36
  $modify = [];
 
37
  // Add a default content-type if possible.
38
  if (!$request->hasHeader('Content-Type')) {
39
  if ($uri = $request->getBody()->getMetadata('uri')) {
40
- if ($type = \_PhpScoper5b6804f9734c8\GuzzleHttp\Psr7\mimetype_from_filename($uri)) {
41
  $modify['set_headers']['Content-Type'] = $type;
42
  }
43
  }
44
  }
 
45
  // Add a default content-length or transfer-encoding header.
46
- if (!$request->hasHeader('Content-Length') && !$request->hasHeader('Transfer-Encoding')) {
 
 
47
  $size = $request->getBody()->getSize();
48
  if ($size !== null) {
49
  $modify['set_headers']['Content-Length'] = $size;
@@ -51,34 +59,46 @@ class PrepareBodyMiddleware
51
  $modify['set_headers']['Transfer-Encoding'] = 'chunked';
52
  }
53
  }
 
54
  // Add the expect header if needed.
55
  $this->addExpectHeader($request, $options, $modify);
56
- return $fn(\_PhpScoper5b6804f9734c8\GuzzleHttp\Psr7\modify_request($request, $modify), $options);
 
57
  }
58
- private function addExpectHeader(\_PhpScoper5b6804f9734c8\Psr\Http\Message\RequestInterface $request, array $options, array &$modify)
59
- {
 
 
 
 
60
  // Determine if the Expect header should be used
61
  if ($request->hasHeader('Expect')) {
62
  return;
63
  }
 
64
  $expect = isset($options['expect']) ? $options['expect'] : null;
 
65
  // Return if disabled or if you're not using HTTP/1.1 or HTTP/2.0
66
- if ($expect === \false || $request->getProtocolVersion() < 1.1) {
67
  return;
68
  }
 
69
  // The expect header is unconditionally enabled
70
- if ($expect === \true) {
71
  $modify['set_headers']['Expect'] = '100-Continue';
72
  return;
73
  }
 
74
  // By default, send the expect header when the payload is > 1mb
75
  if ($expect === null) {
76
  $expect = 1048576;
77
  }
 
78
  // Always add if the body cannot be rewound, the size cannot be
79
  // determined, or the size is greater than the cutoff threshold
80
  $body = $request->getBody();
81
  $size = $body->getSize();
 
82
  if ($size === null || $size >= (int) $expect || !$body->isSeekable()) {
83
  $modify['set_headers']['Expect'] = '100-Continue';
84
  }
1
  <?php
2
+ namespace GuzzleHttp;
3
 
4
+ use GuzzleHttp\Promise\PromiseInterface;
5
+ use GuzzleHttp\Psr7;
6
+ use Psr\Http\Message\RequestInterface;
7
 
 
 
 
8
  /**
9
  * Prepares requests that contain a body, adding the Content-Length,
10
  * Content-Type, and Expect headers.
13
  {
14
  /** @var callable */
15
  private $nextHandler;
16
+
17
  /**
18
  * @param callable $nextHandler Next handler to invoke.
19
  */
21
  {
22
  $this->nextHandler = $nextHandler;
23
  }
24
+
25
  /**
26
  * @param RequestInterface $request
27
  * @param array $options
28
  *
29
  * @return PromiseInterface
30
  */
31
+ public function __invoke(RequestInterface $request, array $options)
32
  {
33
  $fn = $this->nextHandler;
34
+
35
  // Don't do anything if the request has no body.
36
  if ($request->getBody()->getSize() === 0) {
37
  return $fn($request, $options);
38
  }
39
+
40
  $modify = [];
41
+
42
  // Add a default content-type if possible.
43
  if (!$request->hasHeader('Content-Type')) {
44
  if ($uri = $request->getBody()->getMetadata('uri')) {
45
+ if ($type = Psr7\mimetype_from_filename($uri)) {
46
  $modify['set_headers']['Content-Type'] = $type;
47
  }
48
  }
49
  }
50
+
51
  // Add a default content-length or transfer-encoding header.
52
+ if (!$request->hasHeader('Content-Length')
53
+ && !$request->hasHeader('Transfer-Encoding')
54
+ ) {
55
  $size = $request->getBody()->getSize();
56
  if ($size !== null) {
57
  $modify['set_headers']['Content-Length'] = $size;
59
  $modify['set_headers']['Transfer-Encoding'] = 'chunked';
60
  }
61
  }
62
+
63
  // Add the expect header if needed.
64
  $this->addExpectHeader($request, $options, $modify);
65
+
66
+ return $fn(Psr7\modify_request($request, $modify), $options);
67
  }
68
+
69
+ private function addExpectHeader(
70
+ RequestInterface $request,
71
+ array $options,
72
+ array &$modify
73
+ ) {
74
  // Determine if the Expect header should be used
75
  if ($request->hasHeader('Expect')) {
76
  return;
77
  }
78
+
79
  $expect = isset($options['expect']) ? $options['expect'] : null;
80
+
81
  // Return if disabled or if you're not using HTTP/1.1 or HTTP/2.0
82
+ if ($expect === false || $request->getProtocolVersion() < 1.1) {
83
  return;
84
  }
85
+
86
  // The expect header is unconditionally enabled
87
+ if ($expect === true) {
88
  $modify['set_headers']['Expect'] = '100-Continue';
89
  return;
90
  }
91
+
92
  // By default, send the expect header when the payload is > 1mb
93
  if ($expect === null) {
94
  $expect = 1048576;
95
  }
96
+
97
  // Always add if the body cannot be rewound, the size cannot be
98
  // determined, or the size is greater than the cutoff threshold
99
  $body = $request->getBody();
100
  $size = $body->getSize();
101
+
102
  if ($size === null || $size >= (int) $expect || !$body->isSeekable()) {
103
  $modify['set_headers']['Expect'] = '100-Continue';
104
  }
includes/mollie-api-php/vendor/guzzlehttp/guzzle/src/RedirectMiddleware.php CHANGED
@@ -1,14 +1,14 @@
1
  <?php
 
2
 
3
- namespace _PhpScoper5b6804f9734c8\GuzzleHttp;
 
 
 
 
 
 
4
 
5
- use _PhpScoper5b6804f9734c8\GuzzleHttp\Exception\BadResponseException;
6
- use _PhpScoper5b6804f9734c8\GuzzleHttp\Exception\TooManyRedirectsException;
7
- use _PhpScoper5b6804f9734c8\GuzzleHttp\Promise\PromiseInterface;
8
- use _PhpScoper5b6804f9734c8\GuzzleHttp\Psr7;
9
- use _PhpScoper5b6804f9734c8\Psr\Http\Message\RequestInterface;
10
- use _PhpScoper5b6804f9734c8\Psr\Http\Message\ResponseInterface;
11
- use _PhpScoper5b6804f9734c8\Psr\Http\Message\UriInterface;
12
  /**
13
  * Request redirect middleware.
14
  *
@@ -18,10 +18,20 @@ use _PhpScoper5b6804f9734c8\Psr\Http\Message\UriInterface;
18
  class RedirectMiddleware
19
  {
20
  const HISTORY_HEADER = 'X-Guzzle-Redirect-History';
 
21
  const STATUS_HISTORY_HEADER = 'X-Guzzle-Redirect-Status-History';
22
- public static $defaultSettings = ['max' => 5, 'protocols' => ['http', 'https'], 'strict' => \false, 'referer' => \false, 'track_redirects' => \false];
 
 
 
 
 
 
 
 
23
  /** @var callable */
24
  private $nextHandler;
 
25
  /**
26
  * @param callable $nextHandler Next handler to invoke.
27
  */
@@ -29,33 +39,40 @@ class RedirectMiddleware
29
  {
30
  $this->nextHandler = $nextHandler;
31
  }
 
32
  /**
33
  * @param RequestInterface $request
34
  * @param array $options
35
  *
36
  * @return PromiseInterface
37
  */
38
- public function __invoke(\_PhpScoper5b6804f9734c8\Psr\Http\Message\RequestInterface $request, array $options)
39
  {
40
  $fn = $this->nextHandler;
 
41
  if (empty($options['allow_redirects'])) {
42
  return $fn($request, $options);
43
  }
44
- if ($options['allow_redirects'] === \true) {
 
45
  $options['allow_redirects'] = self::$defaultSettings;
46
- } elseif (!\is_array($options['allow_redirects'])) {
47
  throw new \InvalidArgumentException('allow_redirects must be true, false, or array');
48
  } else {
49
  // Merge the default settings with the provided settings
50
  $options['allow_redirects'] += self::$defaultSettings;
51
  }
 
52
  if (empty($options['allow_redirects']['max'])) {
53
  return $fn($request, $options);
54
  }
55
- return $fn($request, $options)->then(function (\_PhpScoper5b6804f9734c8\Psr\Http\Message\ResponseInterface $response) use($request, $options) {
56
- return $this->checkRedirect($request, $options, $response);
57
- });
 
 
58
  }
 
59
  /**
60
  * @param RequestInterface $request
61
  * @param array $options
@@ -63,46 +80,77 @@ class RedirectMiddleware
63
  *
64
  * @return ResponseInterface|PromiseInterface
65
  */
66
- public function checkRedirect(\_PhpScoper5b6804f9734c8\Psr\Http\Message\RequestInterface $request, array $options, \_PhpScoper5b6804f9734c8\Psr\Http\Message\ResponseInterface $response)
67
- {
68
- if (\substr($response->getStatusCode(), 0, 1) != '3' || !$response->hasHeader('Location')) {
 
 
 
 
 
69
  return $response;
70
  }
 
71
  $this->guardMax($request, $options);
72
  $nextRequest = $this->modifyRequest($request, $options, $response);
 
73
  if (isset($options['allow_redirects']['on_redirect'])) {
74
- \call_user_func($options['allow_redirects']['on_redirect'], $request, $response, $nextRequest->getUri());
 
 
 
 
 
75
  }
 
76
  /** @var PromiseInterface|ResponseInterface $promise */
77
  $promise = $this($nextRequest, $options);
 
78
  // Add headers to be able to track history of redirects.
79
  if (!empty($options['allow_redirects']['track_redirects'])) {
80
- return $this->withTracking($promise, (string) $nextRequest->getUri(), $response->getStatusCode());
 
 
 
 
81
  }
 
82
  return $promise;
83
  }
84
- private function withTracking(\_PhpScoper5b6804f9734c8\GuzzleHttp\Promise\PromiseInterface $promise, $uri, $statusCode)
 
85
  {
86
- return $promise->then(function (\_PhpScoper5b6804f9734c8\Psr\Http\Message\ResponseInterface $response) use($uri, $statusCode) {
87
- // Note that we are pushing to the front of the list as this
88
- // would be an earlier response than what is currently present
89
- // in the history header.
90
- $historyHeader = $response->getHeader(self::HISTORY_HEADER);
91
- $statusHeader = $response->getHeader(self::STATUS_HISTORY_HEADER);
92
- \array_unshift($historyHeader, $uri);
93
- \array_unshift($statusHeader, $statusCode);
94
- return $response->withHeader(self::HISTORY_HEADER, $historyHeader)->withHeader(self::STATUS_HISTORY_HEADER, $statusHeader);
95
- });
 
 
 
96
  }
97
- private function guardMax(\_PhpScoper5b6804f9734c8\Psr\Http\Message\RequestInterface $request, array &$options)
 
98
  {
99
- $current = isset($options['__redirect_count']) ? $options['__redirect_count'] : 0;
 
 
100
  $options['__redirect_count'] = $current + 1;
101
  $max = $options['allow_redirects']['max'];
 
102
  if ($options['__redirect_count'] > $max) {
103
- throw new \_PhpScoper5b6804f9734c8\GuzzleHttp\Exception\TooManyRedirectsException("Will not follow more than {$max} redirects", $request);
 
 
 
104
  }
105
  }
 
106
  /**
107
  * @param RequestInterface $request
108
  * @param array $options
@@ -110,35 +158,48 @@ class RedirectMiddleware
110
  *
111
  * @return RequestInterface
112
  */
113
- public function modifyRequest(\_PhpScoper5b6804f9734c8\Psr\Http\Message\RequestInterface $request, array $options, \_PhpScoper5b6804f9734c8\Psr\Http\Message\ResponseInterface $response)
114
- {
 
 
 
115
  // Request modifications to apply.
116
  $modify = [];
117
  $protocols = $options['allow_redirects']['protocols'];
 
118
  // Use a GET request if this is an entity enclosing request and we are
119
  // not forcing RFC compliance, but rather emulating what all browsers
120
  // would do.
121
  $statusCode = $response->getStatusCode();
122
- if ($statusCode == 303 || $statusCode <= 302 && $request->getBody() && !$options['allow_redirects']['strict']) {
 
 
123
  $modify['method'] = 'GET';
124
  $modify['body'] = '';
125
  }
 
126
  $modify['uri'] = $this->redirectUri($request, $response, $protocols);
127
- \_PhpScoper5b6804f9734c8\GuzzleHttp\Psr7\rewind_body($request);
 
128
  // Add the Referer header if it is told to do so and only
129
  // add the header if we are not redirecting from https to http.
130
- if ($options['allow_redirects']['referer'] && $modify['uri']->getScheme() === $request->getUri()->getScheme()) {
 
 
131
  $uri = $request->getUri()->withUserInfo('', '');
132
  $modify['set_headers']['Referer'] = (string) $uri;
133
  } else {
134
  $modify['remove_headers'][] = 'Referer';
135
  }
 
136
  // Remove Authorization header if host is different.
137
  if ($request->getUri()->getHost() !== $modify['uri']->getHost()) {
138
  $modify['remove_headers'][] = 'Authorization';
139
  }
140
- return \_PhpScoper5b6804f9734c8\GuzzleHttp\Psr7\modify_request($request, $modify);
 
141
  }
 
142
  /**
143
  * Set the appropriate URL on the request based on the location header
144
  *
@@ -148,13 +209,29 @@ class RedirectMiddleware
148
  *
149
  * @return UriInterface
150
  */
151
- private function redirectUri(\_PhpScoper5b6804f9734c8\Psr\Http\Message\RequestInterface $request, \_PhpScoper5b6804f9734c8\Psr\Http\Message\ResponseInterface $response, array $protocols)
152
- {
153
- $location = \_PhpScoper5b6804f9734c8\GuzzleHttp\Psr7\UriResolver::resolve($request->getUri(), new \_PhpScoper5b6804f9734c8\GuzzleHttp\Psr7\Uri($response->getHeaderLine('Location')));
 
 
 
 
 
 
 
154
  // Ensure that the redirect URI is allowed based on the protocols.
155
- if (!\in_array($location->getScheme(), $protocols)) {
156
- throw new \_PhpScoper5b6804f9734c8\GuzzleHttp\Exception\BadResponseException(\sprintf('Redirect URI, %s, does not use one of the allowed redirect protocols: %s', $location, \implode(', ', $protocols)), $request, $response);
 
 
 
 
 
 
 
 
157
  }
 
158
  return $location;
159
  }
160
  }
1
  <?php
2
+ namespace GuzzleHttp;
3
 
4
+ use GuzzleHttp\Exception\BadResponseException;
5
+ use GuzzleHttp\Exception\TooManyRedirectsException;
6
+ use GuzzleHttp\Promise\PromiseInterface;
7
+ use GuzzleHttp\Psr7;
8
+ use Psr\Http\Message\RequestInterface;
9
+ use Psr\Http\Message\ResponseInterface;
10
+ use Psr\Http\Message\UriInterface;
11
 
 
 
 
 
 
 
 
12
  /**
13
  * Request redirect middleware.
14
  *
18
  class RedirectMiddleware
19
  {
20
  const HISTORY_HEADER = 'X-Guzzle-Redirect-History';
21
+
22
  const STATUS_HISTORY_HEADER = 'X-Guzzle-Redirect-Status-History';
23
+
24
+ public static $defaultSettings = [
25
+ 'max' => 5,
26
+ 'protocols' => ['http', 'https'],
27
+ 'strict' => false,
28
+ 'referer' => false,
29
+ 'track_redirects' => false,
30
+ ];
31
+
32
  /** @var callable */
33
  private $nextHandler;
34
+
35
  /**
36
  * @param callable $nextHandler Next handler to invoke.
37
  */
39
  {
40
  $this->nextHandler = $nextHandler;
41
  }
42
+
43
  /**
44
  * @param RequestInterface $request
45
  * @param array $options
46
  *
47
  * @return PromiseInterface
48
  */
49
+ public function __invoke(RequestInterface $request, array $options)
50
  {
51
  $fn = $this->nextHandler;
52
+
53
  if (empty($options['allow_redirects'])) {
54
  return $fn($request, $options);
55
  }
56
+
57
+ if ($options['allow_redirects'] === true) {
58
  $options['allow_redirects'] = self::$defaultSettings;
59
+ } elseif (!is_array($options['allow_redirects'])) {
60
  throw new \InvalidArgumentException('allow_redirects must be true, false, or array');
61
  } else {
62
  // Merge the default settings with the provided settings
63
  $options['allow_redirects'] += self::$defaultSettings;
64
  }
65
+
66
  if (empty($options['allow_redirects']['max'])) {
67
  return $fn($request, $options);
68
  }
69
+
70
+ return $fn($request, $options)
71
+ ->then(function (ResponseInterface $response) use ($request, $options) {
72
+ return $this->checkRedirect($request, $options, $response);
73
+ });
74
  }
75
+
76
  /**
77
  * @param RequestInterface $request
78
  * @param array $options
80
  *
81
  * @return ResponseInterface|PromiseInterface
82
  */
83
+ public function checkRedirect(
84
+ RequestInterface $request,
85
+ array $options,
86
+ ResponseInterface $response
87
+ ) {
88
+ if (substr($response->getStatusCode(), 0, 1) != '3'
89
+ || !$response->hasHeader('Location')
90
+ ) {
91
  return $response;
92
  }
93
+
94
  $this->guardMax($request, $options);
95
  $nextRequest = $this->modifyRequest($request, $options, $response);
96
+
97
  if (isset($options['allow_redirects']['on_redirect'])) {
98
+ call_user_func(
99
+ $options['allow_redirects']['on_redirect'],
100
+ $request,
101
+ $response,
102
+ $nextRequest->getUri()
103
+ );
104
  }
105
+
106
  /** @var PromiseInterface|ResponseInterface $promise */
107
  $promise = $this($nextRequest, $options);
108
+
109
  // Add headers to be able to track history of redirects.
110
  if (!empty($options['allow_redirects']['track_redirects'])) {
111
+ return $this->withTracking(
112
+ $promise,
113
+ (string) $nextRequest->getUri(),
114
+ $response->getStatusCode()
115
+ );
116
  }
117
+
118
  return $promise;
119
  }
120
+
121
+ private function withTracking(PromiseInterface $promise, $uri, $statusCode)
122
  {
123
+ return $promise->then(
124
+ function (ResponseInterface $response) use ($uri, $statusCode) {
125
+ // Note that we are pushing to the front of the list as this
126
+ // would be an earlier response than what is currently present
127
+ // in the history header.
128
+ $historyHeader = $response->getHeader(self::HISTORY_HEADER);
129
+ $statusHeader = $response->getHeader(self::STATUS_HISTORY_HEADER);
130
+ array_unshift($historyHeader, $uri);
131
+ array_unshift($statusHeader, $statusCode);
132
+ return $response->withHeader(self::HISTORY_HEADER, $historyHeader)
133
+ ->withHeader(self::STATUS_HISTORY_HEADER, $statusHeader);
134
+ }
135
+ );
136
  }
137
+
138
+ private function guardMax(RequestInterface $request, array &$options)
139
  {
140
+ $current = isset($options['__redirect_count'])
141
+ ? $options['__redirect_count']
142
+ : 0;
143
  $options['__redirect_count'] = $current + 1;
144
  $max = $options['allow_redirects']['max'];
145
+
146
  if ($options['__redirect_count'] > $max) {
147
+ throw new TooManyRedirectsException(
148
+ "Will not follow more than {$max} redirects",
149
+ $request
150
+ );
151
  }
152
  }
153
+
154
  /**
155
  * @param RequestInterface $request
156
  * @param array $options
158
  *
159
  * @return RequestInterface
160
  */
161
+ public function modifyRequest(
162
+ RequestInterface $request,
163
+ array $options,
164
+ ResponseInterface $response
165
+ ) {
166
  // Request modifications to apply.
167
  $modify = [];
168
  $protocols = $options['allow_redirects']['protocols'];
169
+
170
  // Use a GET request if this is an entity enclosing request and we are
171
  // not forcing RFC compliance, but rather emulating what all browsers
172
  // would do.
173
  $statusCode = $response->getStatusCode();
174
+ if ($statusCode == 303 ||
175
+ ($statusCode <= 302 && $request->getBody() && !$options['allow_redirects']['strict'])
176
+ ) {
177
  $modify['method'] = 'GET';
178
  $modify['body'] = '';
179
  }
180
+
181
  $modify['uri'] = $this->redirectUri($request, $response, $protocols);
182
+ Psr7\rewind_body($request);
183
+
184
  // Add the Referer header if it is told to do so and only
185
  // add the header if we are not redirecting from https to http.
186
+ if ($options['allow_redirects']['referer']
187
+ && $modify['uri']->getScheme() === $request->getUri()->getScheme()
188
+ ) {
189
  $uri = $request->getUri()->withUserInfo('', '');
190
  $modify['set_headers']['Referer'] = (string) $uri;
191
  } else {
192
  $modify['remove_headers'][] = 'Referer';
193
  }
194
+
195
  // Remove Authorization header if host is different.
196
  if ($request->getUri()->getHost() !== $modify['uri']->getHost()) {
197
  $modify['remove_headers'][] = 'Authorization';
198
  }
199
+
200
+ return Psr7\modify_request($request, $modify);
201
  }
202
+
203
  /**
204
  * Set the appropriate URL on the request based on the location header
205
  *
209
  *
210
  * @return UriInterface
211
  */
212
+ private function redirectUri(
213
+ RequestInterface $request,
214
+ ResponseInterface $response,
215
+ array $protocols
216
+ ) {
217
+ $location = Psr7\UriResolver::resolve(
218
+ $request->getUri(),
219
+ new Psr7\Uri($response->getHeaderLine('Location'))
220
+ );
221
+
222
  // Ensure that the redirect URI is allowed based on the protocols.
223
+ if (!in_array($location->getScheme(), $protocols)) {
224
+ throw new BadResponseException(
225
+ sprintf(
226
+ 'Redirect URI, %s, does not use one of the allowed redirect protocols: %s',
227
+ $location,
228
+ implode(', ', $protocols)
229
+ ),
230
+ $request,
231
+ $response
232
+ );
233
  }
234
+
235
  return $location;
236
  }
237
  }
includes/mollie-api-php/vendor/guzzlehttp/guzzle/src/RequestOptions.php CHANGED
@@ -1,6 +1,5 @@
1
  <?php
2
-
3
- namespace _PhpScoper5b6804f9734c8\GuzzleHttp;
4
 
5
  /**
6
  * This class contains a list of built-in Guzzle request options.
@@ -33,6 +32,7 @@ final class RequestOptions
33
  * from the on_redirect function is ignored.
34
  */
35
  const ALLOW_REDIRECTS = 'allow_redirects';
 
36
  /**
37
  * auth: (array) Pass an array of HTTP authentication parameters to use
38
  * with the request. The array must contain the username in index [0],
@@ -41,11 +41,13 @@ final class RequestOptions
41
  * for a request.
42
  */
43
  const AUTH = 'auth';
 
44
  /**
45
  * body: (resource|string|null|int|float|StreamInterface|callable|\Iterator)
46
  * Body to send in the request.
47
  */
48
  const BODY = 'body';
 
49
  /**
50
  * cert: (string|array) Set to a string to specify the path to a file
51
  * containing a PEM formatted SSL client side certificate. If a password
@@ -54,6 +56,7 @@ final class RequestOptions
54
  * in the second array element.
55
  */
56
  const CERT = 'cert';
 
57
  /**
58
  * cookies: (bool|GuzzleHttp\Cookie\CookieJarInterface, default=false)
59
  * Specifies whether or not cookies are used in a request or what cookie
@@ -62,28 +65,33 @@ final class RequestOptions
62
  * an instance of {@see GuzzleHttp\Cookie\CookieJarInterface}.
63
  */
64
  const COOKIES = 'cookies';
 
65
  /**
66
  * connect_timeout: (float, default=0) Float describing the number of
67
  * seconds to wait while trying to connect to a server. Use 0 to wait
68
  * indefinitely (the default behavior).
69
  */
70
  const CONNECT_TIMEOUT = 'connect_timeout';
 
71
  /**
72
  * debug: (bool|resource) Set to true or set to a PHP stream returned by
73
  * fopen() enable debug output with the HTTP handler used to send a
74
  * request.
75
  */
76
  const DEBUG = 'debug';
 
77
  /**
78
  * decode_content: (bool, default=true) Specify whether or not
79
  * Content-Encoding responses (gzip, deflate, etc.) are automatically
80
  * decoded.
81
  */
82
  const DECODE_CONTENT = 'decode_content';
 
83
  /**
84
  * delay: (int) The amount of time to delay before sending in milliseconds.
85
  */
86
  const DELAY = 'delay';
 
87
  /**
88
  * expect: (bool|integer) Controls the behavior of the
89
  * "Expect: 100-Continue" header.
@@ -101,6 +109,7 @@ final class RequestOptions
101
  * using HTTP/1.1.
102
  */
103
  const EXPECT = 'expect';
 
104
  /**
105
  * form_params: (array) Associative array of form field names to values
106
  * where each value is a string or array of strings. Sets the Content-Type
@@ -108,11 +117,13 @@ final class RequestOptions
108
  * is already present.
109
  */
110
  const FORM_PARAMS = 'form_params';
 
111
  /**
112
  * headers: (array) Associative array of HTTP headers. Each value MUST be
113
  * a string or array of strings.
114
  */
115
  const HEADERS = 'headers';
 
116
  /**
117
  * http_errors: (bool, default=true) Set to false to disable exceptions
118
  * when a non- successful HTTP response is received. By default,
@@ -120,12 +131,14 @@ final class RequestOptions
120
  * works if your handler has the `httpErrors` middleware.
121
  */
122
  const HTTP_ERRORS = 'http_errors';
 
123
  /**
124
  * json: (mixed) Adds JSON data to a request. The provided value is JSON
125
  * encoded and a Content-Type header of application/json will be added to
126
  * the request if no Content-Type header is already present.
127
  */
128
  const JSON = 'json';
 
129
  /**
130
  * multipart: (array) Array of associative arrays, each containing a
131
  * required "name" key mapping to the form field, name, a required
@@ -136,12 +149,14 @@ final class RequestOptions
136
  * will be added to the part.
137
  */
138
  const MULTIPART = 'multipart';
 
139
  /**
140
  * on_headers: (callable) A callable that is invoked when the HTTP headers
141
  * of the response have been received but the body has not yet begun to
142
  * download.
143
  */
144
  const ON_HEADERS = 'on_headers';
 
145
  /**
146
  * on_stats: (callable) allows you to get access to transfer statistics of
147
  * a request and access the lower level transfer details of the handler
@@ -152,6 +167,7 @@ final class RequestOptions
152
  * taken to send the request.
153
  */
154
  const ON_STATS = 'on_stats';
 
155
  /**
156
  * progress: (callable) Defines a function to invoke when transfer
157
  * progress is made. The function accepts the following positional
@@ -160,12 +176,14 @@ final class RequestOptions
160
  * uploaded, the number of bytes uploaded so far.
161
  */
162
  const PROGRESS = 'progress';
 
163
  /**
164
  * proxy: (string|array) Pass a string to specify an HTTP proxy, or an
165
  * array to specify different proxies for different protocols (where the
166
  * key is the protocol and the value is a proxy string).
167
  */
168
  const PROXY = 'proxy';
 
169
  /**
170
  * query: (array|string) Associative array of query string values to add
171
  * to the request. This option uses PHP's http_build_query() to create
@@ -173,12 +191,14 @@ final class RequestOptions
173
  * control than what this method provides
174
  */
175
  const QUERY = 'query';
 
176
  /**
177
  * sink: (resource|string|StreamInterface) Where the data of the
178
  * response is written to. Defaults to a PHP temp stream. Providing a
179
  * string will write data to a file by the given name.
180
  */
181
  const SINK = 'sink';
 
182
  /**
183
  * synchronous: (bool) Set to true to inform HTTP handlers that you intend
184
  * on waiting on the response. This can be useful for optimizations. Note
@@ -186,6 +206,7 @@ final class RequestOptions
186
  * client methods.
187
  */
188
  const SYNCHRONOUS = 'synchronous';
 
189
  /**
190
  * ssl_key: (array|string) Specify the path to a file containing a private
191
  * SSL key in PEM format. If a password is required, then set to an array
@@ -193,11 +214,13 @@ final class RequestOptions
193
  * by the password required for the certificate in the second element.
194
  */
195
  const SSL_KEY = 'ssl_key';
 
196
  /**
197
  * stream: Set to true to attempt to stream a response rather than
198
  * download it all up-front.
199
  */
200
  const STREAM = 'stream';
 
201
  /**
202
  * verify: (bool|string, default=true) Describes the SSL certificate
203
  * verification behavior of a request. Set to true to enable SSL
@@ -207,20 +230,24 @@ final class RequestOptions
207
  * disk to enable verification using a custom certificate.
208
  */
209
  const VERIFY = 'verify';
 
210
  /**
211
  * timeout: (float, default=0) Float describing the timeout of the
212
  * request in seconds. Use 0 to wait indefinitely (the default behavior).
213
  */
214
  const TIMEOUT = 'timeout';
 
215
  /**
216
  * read_timeout: (float, default=default_socket_timeout ini setting) Float describing
217
  * the body read timeout, for stream requests.
218
  */
219
  const READ_TIMEOUT = 'read_timeout';
 
220
  /**
221
  * version: (float) Specifies the HTTP protocol version to attempt to use.
222
  */
223
  const VERSION = 'version';
 
224
  /**
225
  * force_ip_resolve: (bool) Force client to use only ipv4 or ipv6 protocol
226
  */
1
  <?php
2
+ namespace GuzzleHttp;
 
3
 
4
  /**
5
  * This class contains a list of built-in Guzzle request options.
32
  * from the on_redirect function is ignored.
33
  */
34
  const ALLOW_REDIRECTS = 'allow_redirects';
35
+
36
  /**
37
  * auth: (array) Pass an array of HTTP authentication parameters to use
38
  * with the request. The array must contain the username in index [0],
41
  * for a request.
42
  */
43
  const AUTH = 'auth';
44
+
45
  /**
46
  * body: (resource|string|null|int|float|StreamInterface|callable|\Iterator)
47
  * Body to send in the request.
48
  */
49
  const BODY = 'body';
50
+
51
  /**
52
  * cert: (string|array) Set to a string to specify the path to a file
53
  * containing a PEM formatted SSL client side certificate. If a password
56
  * in the second array element.
57
  */
58
  const CERT = 'cert';
59
+
60
  /**
61
  * cookies: (bool|GuzzleHttp\Cookie\CookieJarInterface, default=false)
62
  * Specifies whether or not cookies are used in a request or what cookie
65
  * an instance of {@see GuzzleHttp\Cookie\CookieJarInterface}.
66
  */
67
  const COOKIES = 'cookies';
68
+
69
  /**
70
  * connect_timeout: (float, default=0) Float describing the number of
71
  * seconds to wait while trying to connect to a server. Use 0 to wait
72
  * indefinitely (the default behavior).
73
  */
74
  const CONNECT_TIMEOUT = 'connect_timeout';
75
+
76
  /**
77
  * debug: (bool|resource) Set to true or set to a PHP stream returned by
78
  * fopen() enable debug output with the HTTP handler used to send a
79
  * request.
80
  */
81
  const DEBUG = 'debug';
82
+
83
  /**
84
  * decode_content: (bool, default=true) Specify whether or not
85
  * Content-Encoding responses (gzip, deflate, etc.) are automatically
86
  * decoded.
87
  */
88
  const DECODE_CONTENT = 'decode_content';
89
+
90
  /**
91
  * delay: (int) The amount of time to delay before sending in milliseconds.
92
  */
93
  const DELAY = 'delay';
94
+
95
  /**
96
  * expect: (bool|integer) Controls the behavior of the
97
  * "Expect: 100-Continue" header.
109
  * using HTTP/1.1.
110
  */
111
  const EXPECT = 'expect';
112
+
113
  /**
114
  * form_params: (array) Associative array of form field names to values
115
  * where each value is a string or array of strings. Sets the Content-Type
117
  * is already present.
118
  */
119
  const FORM_PARAMS = 'form_params';
120
+
121
  /**
122
  * headers: (array) Associative array of HTTP headers. Each value MUST be
123
  * a string or array of strings.
124
  */
125
  const HEADERS = 'headers';
126
+
127
  /**
128
  * http_errors: (bool, default=true) Set to false to disable exceptions
129
  * when a non- successful HTTP response is received. By default,
131
  * works if your handler has the `httpErrors` middleware.
132
  */
133
  const HTTP_ERRORS = 'http_errors';
134
+
135
  /**
136
  * json: (mixed) Adds JSON data to a request. The provided value is JSON
137
  * encoded and a Content-Type header of application/json will be added to
138
  * the request if no Content-Type header is already present.
139
  */
140
  const JSON = 'json';
141
+
142
  /**
143
  * multipart: (array) Array of associative arrays, each containing a
144
  * required "name" key mapping to the form field, name, a required
149
  * will be added to the part.
150
  */
151
  const MULTIPART = 'multipart';
152
+
153
  /**
154
  * on_headers: (callable) A callable that is invoked when the HTTP headers
155
  * of the response have been received but the body has not yet begun to
156
  * download.
157
  */
158
  const ON_HEADERS = 'on_headers';
159
+
160
  /**
161
  * on_stats: (callable) allows you to get access to transfer statistics of
162
  * a request and access the lower level transfer details of the handler
167
  * taken to send the request.
168
  */
169
  const ON_STATS = 'on_stats';
170
+
171
  /**
172
  * progress: (callable) Defines a function to invoke when transfer
173
  * progress is made. The function accepts the following positional
176
  * uploaded, the number of bytes uploaded so far.
177
  */
178
  const PROGRESS = 'progress';
179
+
180
  /**
181
  * proxy: (string|array) Pass a string to specify an HTTP proxy, or an
182
  * array to specify different proxies for different protocols (where the
183
  * key is the protocol and the value is a proxy string).
184
  */
185
  const PROXY = 'proxy';
186
+
187
  /**
188
  * query: (array|string) Associative array of query string values to add
189
  * to the request. This option uses PHP's http_build_query() to create
191
  * control than what this method provides
192
  */
193
  const QUERY = 'query';
194
+
195
  /**
196
  * sink: (resource|string|StreamInterface) Where the data of the
197
  * response is written to. Defaults to a PHP temp stream. Providing a
198
  * string will write data to a file by the given name.
199
  */
200
  const SINK = 'sink';
201
+
202
  /**
203
  * synchronous: (bool) Set to true to inform HTTP handlers that you intend
204
  * on waiting on the response. This can be useful for optimizations. Note
206
  * client methods.
207
  */
208
  const SYNCHRONOUS = 'synchronous';
209
+
210
  /**
211
  * ssl_key: (array|string) Specify the path to a file containing a private
212
  * SSL key in PEM format. If a password is required, then set to an array
214
  * by the password required for the certificate in the second element.
215
  */
216
  const SSL_KEY = 'ssl_key';
217
+
218
  /**
219
  * stream: Set to true to attempt to stream a response rather than
220
  * download it all up-front.
221
  */
222
  const STREAM = 'stream';
223
+
224
  /**
225
  * verify: (bool|string, default=true) Describes the SSL certificate
226
  * verification behavior of a request. Set to true to enable SSL
230
  * disk to enable verification using a custom certificate.
231
  */
232
  const VERIFY = 'verify';
233
+
234
  /**
235
  * timeout: (float, default=0) Float describing the timeout of the
236
  * request in seconds. Use 0 to wait indefinitely (the default behavior).
237
  */
238
  const TIMEOUT = 'timeout';
239
+
240
  /**
241
  * read_timeout: (float, default=default_socket_timeout ini setting) Float describing
242
  * the body read timeout, for stream requests.
243
  */
244
  const READ_TIMEOUT = 'read_timeout';
245
+
246
  /**
247
  * version: (float) Specifies the HTTP protocol version to attempt to use.
248
  */
249
  const VERSION = 'version';
250
+
251
  /**
252
  * force_ip_resolve: (bool) Force client to use only ipv4 or ipv6 protocol
253
  */
includes/mollie-api-php/vendor/guzzlehttp/guzzle/src/RetryMiddleware.php CHANGED
@@ -1,12 +1,12 @@
1
  <?php
 
2
 
3
- namespace _PhpScoper5b6804f9734c8\GuzzleHttp;
 
 
 
 
4
 
5
- use _PhpScoper5b6804f9734c8\GuzzleHttp\Promise\PromiseInterface;
6
- use _PhpScoper5b6804f9734c8\GuzzleHttp\Promise\RejectedPromise;
7
- use _PhpScoper5b6804f9734c8\GuzzleHttp\Psr7;
8
- use _PhpScoper5b6804f9734c8\Psr\Http\Message\RequestInterface;
9
- use _PhpScoper5b6804f9734c8\Psr\Http\Message\ResponseInterface;
10
  /**
11
  * Middleware that retries requests based on the boolean result of
12
  * invoking the provided "decider" function.
@@ -15,8 +15,10 @@ class RetryMiddleware
15
  {
16
  /** @var callable */
17
  private $nextHandler;
 
18
  /** @var callable */
19
  private $decider;
 
20
  /**
21
  * @param callable $decider Function that accepts the number of retries,
22
  * a request, [response], and [exception] and
@@ -27,12 +29,16 @@ class RetryMiddleware
27
  * and [response] and returns the number of
28
  * milliseconds to delay.
29
  */
30
- public function __construct(callable $decider, callable $nextHandler, callable $delay = null)
31
- {
 
 
 
32
  $this->decider = $decider;
33
  $this->nextHandler = $nextHandler;
34
  $this->delay = $delay ?: __CLASS__ . '::exponentialDelay';
35
  }
 
36
  /**
37
  * Default exponential backoff delay function.
38
  *
@@ -42,43 +48,65 @@ class RetryMiddleware
42
  */
43
  public static function exponentialDelay($retries)
44
  {
45
- return (int) \pow(2, $retries - 1);
46
  }
 
47
  /**
48
  * @param RequestInterface $request
49
  * @param array $options
50
  *
51
  * @return PromiseInterface
52
  */
53
- public function __invoke(\_PhpScoper5b6804f9734c8\Psr\Http\Message\RequestInterface $request, array $options)
54
  {
55
  if (!isset($options['retries'])) {
56
  $options['retries'] = 0;
57
  }
 
58
  $fn = $this->nextHandler;
59
- return $fn($request, $options)->then($this->onFulfilled($request, $options), $this->onRejected($request, $options));
 
 
 
 
60
  }
61
- private function onFulfilled(\_PhpScoper5b6804f9734c8\Psr\Http\Message\RequestInterface $req, array $options)
 
62
  {
63
- return function ($value) use($req, $options) {
64
- if (!\call_user_func($this->decider, $options['retries'], $req, $value, null)) {
 
 
 
 
 
 
65
  return $value;
66
  }
67
  return $this->doRetry($req, $options, $value);
68
  };
69
  }
70
- private function onRejected(\_PhpScoper5b6804f9734c8\Psr\Http\Message\RequestInterface $req, array $options)
 
71
  {
72
- return function ($reason) use($req, $options) {
73
- if (!\call_user_func($this->decider, $options['retries'], $req, null, $reason)) {
74
- return \_PhpScoper5b6804f9734c8\GuzzleHttp\Promise\rejection_for($reason);
 
 
 
 
 
 
75
  }
76
  return $this->doRetry($req, $options);
77
  };
78
  }
79
- private function doRetry(\_PhpScoper5b6804f9734c8\Psr\Http\Message\RequestInterface $request, array $options, \_PhpScoper5b6804f9734c8\Psr\Http\Message\ResponseInterface $response = null)
 
80
  {
81
- $options['delay'] = \call_user_func($this->delay, ++$options['retries'], $response);
 
82
  return $this($request, $options);
83
  }
84
  }
1
  <?php
2
+ namespace GuzzleHttp;
3
 
4
+ use GuzzleHttp\Promise\PromiseInterface;
5
+ use GuzzleHttp\Promise\RejectedPromise;
6
+ use GuzzleHttp\Psr7;
7
+ use Psr\Http\Message\RequestInterface;
8
+ use Psr\Http\Message\ResponseInterface;
9
 
 
 
 
 
 
10
  /**
11
  * Middleware that retries requests based on the boolean result of
12
  * invoking the provided "decider" function.
15
  {
16
  /** @var callable */
17
  private $nextHandler;
18
+
19
  /** @var callable */
20
  private $decider;
21
+
22
  /**
23
  * @param callable $decider Function that accepts the number of retries,
24
  * a request, [response], and [exception] and
29
  * and [response] and returns the number of
30
  * milliseconds to delay.
31
  */
32
+ public function __construct(
33
+ callable $decider,
34
+ callable $nextHandler,
35
+ callable $delay = null
36
+ ) {
37
  $this->decider = $decider;
38
  $this->nextHandler = $nextHandler;
39
  $this->delay = $delay ?: __CLASS__ . '::exponentialDelay';
40
  }
41
+
42
  /**
43
  * Default exponential backoff delay function.
44
  *
48
  */
49
  public static function exponentialDelay($retries)
50
  {
51
+ return (int) pow(2, $retries - 1);
52
  }
53
+
54
  /**
55
  * @param RequestInterface $request
56
  * @param array $options
57
  *
58
  * @return PromiseInterface
59
  */
60
+ public function __invoke(RequestInterface $request, array $options)
61
  {
62
  if (!isset($options['retries'])) {
63
  $options['retries'] = 0;
64
  }
65
+
66
  $fn = $this->nextHandler;
67
+ return $fn($request, $options)
68
+ ->then(
69
+ $this->onFulfilled($request, $options),
70
+ $this->onRejected($request, $options)
71
+ );
72
  }
73
+
74
+ private function onFulfilled(RequestInterface $req, array $options)
75
  {
76
+ return function ($value) use ($req, $options) {
77
+ if (!call_user_func(
78
+ $this->decider,
79
+ $options['retries'],
80
+ $req,
81
+ $value,
82
+ null
83
+ )) {
84
  return $value;
85
  }
86
  return $this->doRetry($req, $options, $value);
87
  };
88
  }
89
+
90
+ private function onRejected(RequestInterface $req, array $options)
91
  {
92
+ return function ($reason) use ($req, $options) {
93
+ if (!call_user_func(
94
+ $this->decider,
95
+ $options['retries'],
96
+ $req,
97
+ null,
98
+ $reason
99
+ )) {
100
+ return \GuzzleHttp\Promise\rejection_for($reason);
101
  }
102
  return $this->doRetry($req, $options);
103
  };
104
  }
105
+
106
+ private function doRetry(RequestInterface $request, array $options, ResponseInterface $response = null)
107
  {
108
+ $options['delay'] = call_user_func($this->delay, ++$options['retries'], $response);
109
+
110
  return $this($request, $options);
111
  }
112
  }
includes/mollie-api-php/vendor/guzzlehttp/guzzle/src/TransferStats.php CHANGED
@@ -1,10 +1,10 @@
1
  <?php
 
2
 
3
- namespace _PhpScoper5b6804f9734c8\GuzzleHttp;
 
 
4
 
5
- use _PhpScoper5b6804f9734c8\Psr\Http\Message\RequestInterface;
6
- use _PhpScoper5b6804f9734c8\Psr\Http\Message\ResponseInterface;
7
- use _PhpScoper5b6804f9734c8\Psr\Http\Message\UriInterface;
8
  /**
9
  * Represents data at the point after it was transferred either successfully
10
  * or after a network error.
@@ -16,6 +16,7 @@ final class TransferStats
16
  private $transferTime;
17
  private $handlerStats;
18
  private $handlerErrorData;
 
19
  /**
20
  * @param RequestInterface $request Request that was sent.
21
  * @param ResponseInterface $response Response received (if any)
@@ -23,14 +24,20 @@ final class TransferStats
23
  * @param mixed $handlerErrorData Handler error data.
24
  * @param array $handlerStats Handler specific stats.
25
  */
26
- public function __construct(\_PhpScoper5b6804f9734c8\Psr\Http\Message\RequestInterface $request, \_PhpScoper5b6804f9734c8\Psr\Http\Message\ResponseInterface $response = null, $transferTime = null, $handlerErrorData = null, $handlerStats = [])
27
- {
 
 
 
 
 
28
  $this->request = $request;
29
  $this->response = $response;
30
  $this->transferTime = $transferTime;
31
  $this->handlerErrorData = $handlerErrorData;
32
  $this->handlerStats = $handlerStats;
33
  }
 
34
  /**
35
  * @return RequestInterface
36
  */
@@ -38,6 +45,7 @@ final class TransferStats
38
  {
39
  return $this->request;
40
  }
 
41
  /**
42
  * Returns the response that was received (if any).
43
  *
@@ -47,6 +55,7 @@ final class TransferStats
47
  {
48
  return $this->response;
49
  }
 
50
  /**
51
  * Returns true if a response was received.
52
  *
@@ -56,6 +65,7 @@ final class TransferStats
56
  {
57
  return $this->response !== null;
58
  }
 
59
  /**
60
  * Gets handler specific error data.
61
  *
@@ -69,6 +79,7 @@ final class TransferStats
69
  {
70
  return $this->handlerErrorData;
71
  }
 
72
  /**
73
  * Get the effective URI the request was sent to.
74
  *
@@ -78,6 +89,7 @@ final class TransferStats
78
  {
79
  return $this->request->getUri();
80
  }
 
81
  /**
82
  * Get the estimated time the request was being transferred by the handler.
83
  *
@@ -87,6 +99,7 @@ final class TransferStats
87
  {
88
  return $this->transferTime;
89
  }
 
90
  /**
91
  * Gets an array of all of the handler specific transfer data.
92
  *
@@ -96,6 +109,7 @@ final class TransferStats
96
  {
97
  return $this->handlerStats;
98
  }
 
99
  /**
100
  * Get a specific handler statistic from the handler by name.
101
  *
@@ -105,6 +119,8 @@ final class TransferStats
105
  */
106
  public function getHandlerStat($stat)
107
  {
108
- return isset($this->handlerStats[$stat]) ? $this->handlerStats[$stat] : null;
 
 
109
  }
110
  }
1
  <?php
2
+ namespace GuzzleHttp;
3
 
4
+ use Psr\Http\Message\RequestInterface;
5
+ use Psr\Http\Message\ResponseInterface;
6
+ use Psr\Http\Message\UriInterface;
7
 
 
 
 
8
  /**
9
  * Represents data at the point after it was transferred either successfully
10
  * or after a network error.
16
  private $transferTime;
17
  private $handlerStats;
18
  private $handlerErrorData;
19
+
20
  /**
21
  * @param RequestInterface $request Request that was sent.
22
  * @param ResponseInterface $response Response received (if any)
24
  * @param mixed $handlerErrorData Handler error data.
25
  * @param array $handlerStats Handler specific stats.
26
  */
27
+ public function __construct(
28
+ RequestInterface $request,
29
+ ResponseInterface $response = null,
30
+ $transferTime = null,
31
+ $handlerErrorData = null,
32
+ $handlerStats = []
33
+ ) {
34
  $this->request = $request;
35
  $this->response = $response;
36
  $this->transferTime = $transferTime;
37
  $this->handlerErrorData = $handlerErrorData;
38
  $this->handlerStats = $handlerStats;
39
  }
40
+
41
  /**
42
  * @return RequestInterface
43
  */
45
  {
46
  return $this->request;
47
  }
48
+
49
  /**
50
  * Returns the response that was received (if any).
51
  *
55
  {
56
  return $this->response;
57
  }
58
+
59
  /**
60
  * Returns true if a response was received.
61
  *
65
  {
66
  return $this->response !== null;
67
  }
68
+
69
  /**
70
  * Gets handler specific error data.
71
  *
79
  {
80
  return $this->handlerErrorData;
81
  }
82
+
83
  /**
84
  * Get the effective URI the request was sent to.
85
  *
89
  {
90
  return $this->request->getUri();
91
  }
92
+
93
  /**
94
  * Get the estimated time the request was being transferred by the handler.
95
  *
99
  {
100
  return $this->transferTime;
101
  }
102
+
103
  /**
104
  * Gets an array of all of the handler specific transfer data.
105
  *
109
  {
110
  return $this->handlerStats;
111
  }
112
+
113
  /**
114
  * Get a specific handler statistic from the handler by name.
115
  *
119
  */
120
  public function getHandlerStat($stat)
121
  {
122
+ return isset($this->handlerStats[$stat])
123
+ ? $this->handlerStats[$stat]
124
+ : null;
125
  }
126
  }
includes/mollie-api-php/vendor/guzzlehttp/guzzle/src/UriTemplate.php CHANGED
@@ -1,6 +1,5 @@
1
  <?php
2
-
3
- namespace _PhpScoper5b6804f9734c8\GuzzleHttp;
4
 
5
  /**
6
  * Expands URI templates. Userland implementation of PECL uri_template.
@@ -11,23 +10,47 @@ class UriTemplate
11
  {
12
  /** @var string URI template */
13
  private $template;
 
14
  /** @var array Variables to use in the template expansion */
15
  private $variables;
 
16
  /** @var array Hash for quick operator lookups */
17
- private static $operatorHash = ['' => ['prefix' => '', 'joiner' => ',', 'query' => \false], '+' => ['prefix' => '', 'joiner' => ',', 'query' => \false], '#' => ['prefix' => '#', 'joiner' => ',', 'query' => \false], '.' => ['prefix' => '.', 'joiner' => '.', 'query' => \false], '/' => ['prefix' => '/', 'joiner' => '/', 'query' => \false], ';' => ['prefix' => ';', 'joiner' => ';', 'query' => \true], '?' => ['prefix' => '?', 'joiner' => '&', 'query' => \true], '&' => ['prefix' => '&', 'joiner' => '&', 'query' => \true]];
 
 
 
 
 
 
 
 
 
 
18
  /** @var array Delimiters */
19
- private static $delims = [':', '/', '?', '#', '[', ']', '@', '!', '$', '&', '\'', '(', ')', '*', '+', ',', ';', '='];
 
 
20
  /** @var array Percent encoded delimiters */
21
- private static $delimsPct = ['%3A', '%2F', '%3F', '%23', '%5B', '%5D', '%40', '%21', '%24', '%26', '%27', '%28', '%29', '%2A', '%2B', '%2C', '%3B', '%3D'];
 
 
 
22
  public function expand($template, array $variables)
23
  {
24
- if (\false === \strpos($template, '{')) {
25
  return $template;
26
  }
 
27
  $this->template = $template;
28
  $this->variables = $variables;
29
- return \preg_replace_callback('/\\{([^\\}]+)\\}/', [$this, 'expandMatch'], $this->template);
 
 
 
 
 
30
  }
 
31
  /**
32
  * Parse an expression into parts
33
  *
@@ -38,30 +61,34 @@ class UriTemplate
38
  private function parseExpression($expression)
39
  {
40
  $result = [];
 
41
  if (isset(self::$operatorHash[$expression[0]])) {
42
  $result['operator'] = $expression[0];
43
- $expression = \substr($expression, 1);
44
  } else {
45
  $result['operator'] = '';
46
  }
47
- foreach (\explode(',', $expression) as $value) {
48
- $value = \trim($value);
 
49
  $varspec = [];
50
- if ($colonPos = \strpos($value, ':')) {
51
- $varspec['value'] = \substr($value, 0, $colonPos);
52
  $varspec['modifier'] = ':';
53
- $varspec['position'] = (int) \substr($value, $colonPos + 1);
54
- } elseif (\substr($value, -1) === '*') {
55
  $varspec['modifier'] = '*';
56
- $varspec['value'] = \substr($value, 0, -1);
57
  } else {
58
  $varspec['value'] = (string) $value;
59
  $varspec['modifier'] = '';
60
  }
61
  $result['values'][] = $varspec;
62
  }
 
63
  return $result;
64
  }
 
65
  /**
66
  * Process an expansion
67
  *
@@ -72,40 +99,51 @@ class UriTemplate
72
  private function expandMatch(array $matches)
73
  {
74
  static $rfc1738to3986 = ['+' => '%20', '%7e' => '~'];
 
75
  $replacements = [];
76
  $parsed = self::parseExpression($matches[1]);
77
  $prefix = self::$operatorHash[$parsed['operator']]['prefix'];
78
  $joiner = self::$operatorHash[$parsed['operator']]['joiner'];
79
  $useQuery = self::$operatorHash[$parsed['operator']]['query'];
 
80
  foreach ($parsed['values'] as $value) {
81
  if (!isset($this->variables[$value['value']])) {
82
  continue;
83
  }
 
84
  $variable = $this->variables[$value['value']];
85
  $actuallyUseQuery = $useQuery;
86
  $expanded = '';
87
- if (\is_array($variable)) {
 
88
  $isAssoc = $this->isAssoc($variable);
89
  $kvp = [];
90
  foreach ($variable as $key => $var) {
91
  if ($isAssoc) {
92
- $key = \rawurlencode($key);
93
- $isNestedArray = \is_array($var);
94
  } else {
95
- $isNestedArray = \false;
96
  }
 
97
  if (!$isNestedArray) {
98
- $var = \rawurlencode($var);
99
- if ($parsed['operator'] === '+' || $parsed['operator'] === '#') {
 
 
100
  $var = $this->decodeReserved($var);
101
  }
102
  }
 
103
  if ($value['modifier'] === '*') {
104
  if ($isAssoc) {
105
  if ($isNestedArray) {
106
  // Nested arrays must allow for deeply nested
107
  // structures.
108
- $var = \strtr(\http_build_query([$key => $var]), $rfc1738to3986);
 
 
 
109
  } else {
110
  $var = $key . '=' . $var;
111
  }
@@ -113,16 +151,18 @@ class UriTemplate
113
  $var = $value['value'] . '=' . $var;
114
  }
115
  }
 
116
  $kvp[$key] = $var;
117
  }
 
118
  if (empty($variable)) {
119
- $actuallyUseQuery = \false;
120
  } elseif ($value['modifier'] === '*') {
121
- $expanded = \implode($joiner, $kvp);
122
  if ($isAssoc) {
123
  // Don't prepend the value name when using the explode
124
  // modifier with an associative array.
125
- $actuallyUseQuery = \false;
126
  }
127
  } else {
128
  if ($isAssoc) {
@@ -134,17 +174,18 @@ class UriTemplate
134
  $v = $k . ',' . $v;
135
  }
136
  }
137
- $expanded = \implode(',', $kvp);
138
  }
139
  } else {
140
  if ($value['modifier'] === ':') {
141
- $variable = \substr($variable, 0, $value['position']);
142
  }
143
- $expanded = \rawurlencode($variable);
144
  if ($parsed['operator'] === '+' || $parsed['operator'] === '#') {
145
  $expanded = $this->decodeReserved($expanded);
146
  }
147
  }
 
148
  if ($actuallyUseQuery) {
149
  if (!$expanded && $joiner !== '&') {
150
  $expanded = $value['value'];
@@ -152,14 +193,18 @@ class UriTemplate
152
  $expanded = $value['value'] . '=' . $expanded;
153
  }
154
  }
 
155
  $replacements[] = $expanded;
156
  }
157
- $ret = \implode($joiner, $replacements);
 
158
  if ($ret && $prefix) {
159
  return $prefix . $ret;
160
  }
 
161
  return $ret;
162
  }
 
163
  /**
164
  * Determines if an array is associative.
165
  *
@@ -174,8 +219,9 @@ class UriTemplate
174
  */
175
  private function isAssoc(array $array)
176
  {
177
- return $array && \array_keys($array)[0] !== 0;
178
  }
 
179
  /**
180
  * Removes percent encoding on reserved characters (used with + and #
181
  * modifiers).
@@ -186,6 +232,6 @@ class UriTemplate
186
  */
187
  private function decodeReserved($string)
188
  {
189
- return \str_replace(self::$delimsPct, self::$delims, $string);
190
  }
191
  }
1
  <?php
2
+ namespace GuzzleHttp;
 
3
 
4
  /**
5
  * Expands URI templates. Userland implementation of PECL uri_template.
10
  {
11
  /** @var string URI template */
12
  private $template;
13
+
14
  /** @var array Variables to use in the template expansion */
15
  private $variables;
16
+
17
  /** @var array Hash for quick operator lookups */
18
+ private static $operatorHash = [
19
+ '' => ['prefix' => '', 'joiner' => ',', 'query' => false],
20
+ '+' => ['prefix' => '', 'joiner' => ',', 'query' => false],
21
+ '#' => ['prefix' => '#', 'joiner' => ',', 'query' => false],
22
+ '.' => ['prefix' => '.', 'joiner' => '.', 'query' => false],
23
+ '/' => ['prefix' => '/', 'joiner' => '/', 'query' => false],
24
+ ';' => ['prefix' => ';', 'joiner' => ';', 'query' => true],
25
+ '?' => ['prefix' => '?', 'joiner' => '&', 'query' => true],
26
+ '&' => ['prefix' => '&', 'joiner' => '&', 'query' => true]
27
+ ];
28
+
29
  /** @var array Delimiters */
30
+ private static $delims = [':', '/', '?', '#', '[', ']', '@', '!', '$',
31
+ '&', '\'', '(', ')', '*', '+', ',', ';', '='];
32
+
33
  /** @var array Percent encoded delimiters */
34
+ private static $delimsPct = ['%3A', '%2F', '%3F', '%23', '%5B', '%5D',
35
+ '%40', '%21', '%24', '%26', '%27', '%28', '%29', '%2A', '%2B', '%2C',
36
+ '%3B', '%3D'];
37
+
38
  public function expand($template, array $variables)
39
  {
40
+ if (false === strpos($template, '{')) {
41
  return $template;
42
  }
43
+
44
  $this->template = $template;
45
  $this->variables = $variables;
46
+
47
+ return preg_replace_callback(
48
+ '/\{([^\}]+)\}/',
49
+ [$this, 'expandMatch'],
50
+ $this->template
51
+ );
52
  }
53
+
54
  /**
55
  * Parse an expression into parts
56
  *
61
  private function parseExpression($expression)
62
  {
63
  $result = [];
64
+
65
  if (isset(self::$operatorHash[$expression[0]])) {
66
  $result['operator'] = $expression[0];
67
+ $expression = substr($expression, 1);
68
  } else {
69
  $result['operator'] = '';
70
  }
71
+
72
+ foreach (explode(',', $expression) as $value) {
73
+ $value = trim($value);
74
  $varspec = [];
75
+ if ($colonPos = strpos($value, ':')) {
76
+ $varspec['value'] = substr($value, 0, $colonPos);
77
  $varspec['modifier'] = ':';
78
+ $varspec['position'] = (int) substr($value, $colonPos + 1);
79
+ } elseif (substr($value, -1) === '*') {
80
  $varspec['modifier'] = '*';
81
+ $varspec['value'] = substr($value, 0, -1);
82
  } else {
83
  $varspec['value'] = (string) $value;
84
  $varspec['modifier'] = '';
85
  }
86
  $result['values'][] = $varspec;
87
  }
88
+
89
  return $result;
90
  }
91
+
92
  /**
93
  * Process an expansion
94
  *
99
  private function expandMatch(array $matches)
100
  {
101
  static $rfc1738to3986 = ['+' => '%20', '%7e' => '~'];
102
+
103
  $replacements = [];
104
  $parsed = self::parseExpression($matches[1]);
105
  $prefix = self::$operatorHash[$parsed['operator']]['prefix'];
106
  $joiner = self::$operatorHash[$parsed['operator']]['joiner'];
107
  $useQuery = self::$operatorHash[$parsed['operator']]['query'];
108
+
109
  foreach ($parsed['values'] as $value) {
110
  if (!isset($this->variables[$value['value']])) {
111
  continue;
112
  }
113
+
114
  $variable = $this->variables[$value['value']];
115
  $actuallyUseQuery = $useQuery;
116
  $expanded = '';
117
+
118
+ if (is_array($variable)) {
119
  $isAssoc = $this->isAssoc($variable);
120
  $kvp = [];
121
  foreach ($variable as $key => $var) {
122
  if ($isAssoc) {
123
+ $key = rawurlencode($key);
124
+ $isNestedArray = is_array($var);
125
  } else {
126
+ $isNestedArray = false;
127
  }
128
+
129
  if (!$isNestedArray) {
130
+ $var = rawurlencode($var);
131
+ if ($parsed['operator'] === '+' ||
132
+ $parsed['operator'] === '#'
133
+ ) {
134
  $var = $this->decodeReserved($var);
135
  }
136
  }
137
+
138
  if ($value['modifier'] === '*') {
139
  if ($isAssoc) {
140
  if ($isNestedArray) {
141
  // Nested arrays must allow for deeply nested
142
  // structures.
143
+ $var = strtr(
144
+ http_build_query([$key => $var]),
145
+ $rfc1738to3986
146
+ );
147
  } else {
148
  $var = $key . '=' . $var;
149
  }
151
  $var = $value['value'] . '=' . $var;
152
  }
153
  }
154
+
155
  $kvp[$key] = $var;
156
  }
157
+
158
  if (empty($variable)) {
159
+ $actuallyUseQuery = false;
160
  } elseif ($value['modifier'] === '*') {
161
+ $expanded = implode($joiner, $kvp);
162
  if ($isAssoc) {
163
  // Don't prepend the value name when using the explode
164
  // modifier with an associative array.
165
+ $actuallyUseQuery = false;
166
  }
167
  } else {
168
  if ($isAssoc) {
174
  $v = $k . ',' . $v;
175
  }
176
  }
177
+ $expanded = implode(',', $kvp);
178
  }
179
  } else {
180
  if ($value['modifier'] === ':') {
181
+ $variable = substr($variable, 0, $value['position']);
182
  }
183
+ $expanded = rawurlencode($variable);
184
  if ($parsed['operator'] === '+' || $parsed['operator'] === '#') {
185
  $expanded = $this->decodeReserved($expanded);
186
  }
187
  }
188
+
189
  if ($actuallyUseQuery) {
190
  if (!$expanded && $joiner !== '&') {
191
  $expanded = $value['value'];
193
  $expanded = $value['value'] . '=' . $expanded;
194
  }
195
  }
196
+
197
  $replacements[] = $expanded;
198
  }
199
+
200
+ $ret = implode($joiner, $replacements);
201
  if ($ret && $prefix) {
202
  return $prefix . $ret;
203
  }
204
+
205
  return $ret;
206
  }
207
+
208
  /**
209
  * Determines if an array is associative.
210
  *
219
  */
220
  private function isAssoc(array $array)
221
  {
222
+ return $array && array_keys($array)[0] !== 0;
223
  }
224
+
225
  /**
226
  * Removes percent encoding on reserved characters (used with + and #
227
  * modifiers).
232
  */
233
  private function decodeReserved($string)
234
  {
235
+ return str_replace(self::$delimsPct, self::$delims, $string);
236
  }
237
  }
includes/mollie-api-php/vendor/guzzlehttp/guzzle/src/functions.php CHANGED
@@ -1,11 +1,11 @@
1
  <?php
 
2
 
3
- namespace _PhpScoper5b6804f9734c8\GuzzleHttp;
 
 
 
4
 
5
- use _PhpScoper5b6804f9734c8\GuzzleHttp\Handler\CurlHandler;
6
- use _PhpScoper5b6804f9734c8\GuzzleHttp\Handler\CurlMultiHandler;
7
- use _PhpScoper5b6804f9734c8\GuzzleHttp\Handler\Proxy;
8
- use _PhpScoper5b6804f9734c8\GuzzleHttp\Handler\StreamHandler;
9
  /**
10
  * Expands a URI template
11
  *
@@ -16,17 +16,20 @@ use _PhpScoper5b6804f9734c8\GuzzleHttp\Handler\StreamHandler;
16
  */
17
  function uri_template($template, array $variables)
18
  {
19
- if (\extension_loaded('uri_template')) {
20
  // @codeCoverageIgnoreStart
21
- return \_PhpScoper5b6804f9734c8\uri_template($template, $variables);
22
  // @codeCoverageIgnoreEnd
23
  }
 
24
  static $uriTemplate;
25
  if (!$uriTemplate) {
26
- $uriTemplate = new \_PhpScoper5b6804f9734c8\GuzzleHttp\UriTemplate();
27
  }
 
28
  return $uriTemplate->expand($template, $variables);
29
  }
 
30
  /**
31
  * Debug function used to describe the provided value type and class.
32
  *
@@ -37,18 +40,19 @@ function uri_template($template, array $variables)
37
  */
38
  function describe_type($input)
39
  {
40
- switch (\gettype($input)) {
41
  case 'object':
42
- return 'object(' . \get_class($input) . ')';
43
  case 'array':
44
- return 'array(' . \count($input) . ')';
45
  default:
46
- \ob_start();
47
- \var_dump($input);
48
  // normalize float vs double
49
- return \str_replace('double(', 'float(', \rtrim(\ob_get_clean()));
50
  }
51
  }
 
52
  /**
53
  * Parses an array of header lines into an associative array of headers.
54
  *
@@ -59,12 +63,17 @@ function describe_type($input)
59
  function headers_from_lines($lines)
60
  {
61
  $headers = [];
 
62
  foreach ($lines as $line) {
63
- $parts = \explode(':', $line, 2);
64
- $headers[\trim($parts[0])][] = isset($parts[1]) ? \trim($parts[1]) : null;
 
 
65
  }
 
66
  return $headers;
67
  }
 
68
  /**
69
  * Returns a debug stream based on the provided variable.
70
  *
@@ -74,13 +83,15 @@ function headers_from_lines($lines)
74
  */
75
  function debug_resource($value = null)
76
  {
77
- if (\is_resource($value)) {
78
  return $value;
79
- } elseif (\defined('STDOUT')) {
80
- return \STDOUT;
81
  }
82
- return \fopen('php://output', 'w');
 
83
  }
 
84
  /**
85
  * Chooses and creates a default handler to use based on the environment.
86
  *
@@ -92,20 +103,26 @@ function debug_resource($value = null)
92
  function choose_handler()
93
  {
94
  $handler = null;
95
- if (\function_exists('curl_multi_exec') && \function_exists('curl_exec')) {
96
- $handler = \_PhpScoper5b6804f9734c8\GuzzleHttp\Handler\Proxy::wrapSync(new \_PhpScoper5b6804f9734c8\GuzzleHttp\Handler\CurlMultiHandler(), new \_PhpScoper5b6804f9734c8\GuzzleHttp\Handler\CurlHandler());
97
- } elseif (\function_exists('curl_exec')) {
98
- $handler = new \_PhpScoper5b6804f9734c8\GuzzleHttp\Handler\CurlHandler();
99
- } elseif (\function_exists('curl_multi_exec')) {
100
- $handler = new \_PhpScoper5b6804f9734c8\GuzzleHttp\Handler\CurlMultiHandler();
101
  }
102
- if (\ini_get('allow_url_fopen')) {
103
- $handler = $handler ? \_PhpScoper5b6804f9734c8\GuzzleHttp\Handler\Proxy::wrapStreaming($handler, new \_PhpScoper5b6804f9734c8\GuzzleHttp\Handler\StreamHandler()) : new \_PhpScoper5b6804f9734c8\GuzzleHttp\Handler\StreamHandler();
 
 
 
104
  } elseif (!$handler) {
105
- throw new \RuntimeException('GuzzleHttp requires cURL, the ' . 'allow_url_fopen ini setting, or a custom HTTP handler.');
 
106
  }
 
107
  return $handler;
108
  }
 
109
  /**
110
  * Get the default User-Agent string to use with Guzzle
111
  *
@@ -114,15 +131,18 @@ function choose_handler()
114
  function default_user_agent()
115
  {
116
  static $defaultAgent = '';
 
117
  if (!$defaultAgent) {
118
- $defaultAgent = 'GuzzleHttp/' . \_PhpScoper5b6804f9734c8\GuzzleHttp\Client::VERSION;
119
- if (\extension_loaded('curl') && \function_exists('curl_version')) {
120
  $defaultAgent .= ' curl/' . \curl_version()['version'];
121
  }
122
- $defaultAgent .= ' PHP/' . \PHP_VERSION;
123
  }
 
124
  return $defaultAgent;
125
  }
 
126
  /**
127
  * Returns the default cacert bundle for the current system.
128
  *
@@ -157,21 +177,26 @@ function default_ca_bundle()
157
  'C:\\windows\\system32\\curl-ca-bundle.crt',
158
  'C:\\windows\\curl-ca-bundle.crt',
159
  ];
 
160
  if ($cached) {
161
  return $cached;
162
  }
163
- if ($ca = \ini_get('openssl.cafile')) {
 
164
  return $cached = $ca;
165
  }
166
- if ($ca = \ini_get('curl.cainfo')) {
 
167
  return $cached = $ca;
168
  }
 
169
  foreach ($cafiles as $filename) {
170
- if (\file_exists($filename)) {
171
  return $cached = $filename;
172
  }
173
  }
174
- throw new \RuntimeException(<<<EOT
 
175
  No system CA bundle could be found in any of the the common system locations.
176
  PHP versions earlier than 5.6 are not properly configured to use the system's
177
  CA bundle by default. In order to verify peer certificates, you will need to
@@ -185,8 +210,9 @@ ini setting to point to the path to the file, allowing you to omit the 'verify'
185
  request option. See http://curl.haxx.se/docs/sslcerts.html for more
186
  information.
187
  EOT
188
- );
189
  }
 
190
  /**
191
  * Creates an associative array of lowercase header names to the actual
192
  * header casing.
@@ -198,11 +224,13 @@ EOT
198
  function normalize_header_keys(array $headers)
199
  {
200
  $result = [];
201
- foreach (\array_keys($headers) as $key) {
202
- $result[\strtolower($key)] = $key;
203
  }
 
204
  return $result;
205
  }
 
206
  /**
207
  * Returns true if the provided host matches any of the no proxy areas.
208
  *
@@ -224,34 +252,38 @@ function normalize_header_keys(array $headers)
224
  */
225
  function is_host_in_noproxy($host, array $noProxyArray)
226
  {
227
- if (\strlen($host) === 0) {
228
  throw new \InvalidArgumentException('Empty host provided');
229
  }
 
230
  // Strip port if present.
231
- if (\strpos($host, ':')) {
232
- $host = \explode($host, ':', 2)[0];
233
  }
 
234
  foreach ($noProxyArray as $area) {
235
  // Always match on wildcards.
236
  if ($area === '*') {
237
- return \true;
238
  } elseif (empty($area)) {
239
  // Don't match on empty values.
240
  continue;
241
  } elseif ($area === $host) {
242
  // Exact matches.
243
- return \true;
244
  } else {
245
  // Special match if the area when prefixed with ".". Remove any
246
  // existing leading "." and add a new leading ".".
247
- $area = '.' . \ltrim($area, '.');
248
- if (\substr($host, -\strlen($area)) === $area) {
249
- return \true;
250
  }
251
  }
252
  }
253
- return \false;
 
254
  }
 
255
  /**
256
  * Wrapper for json_decode that throws when an error occurs.
257
  *
@@ -265,14 +297,18 @@ function is_host_in_noproxy($host, array $noProxyArray)
265
  * @throws \InvalidArgumentException if the JSON cannot be decoded.
266
  * @link http://www.php.net/manual/en/function.json-decode.php
267
  */
268
- function json_decode($json, $assoc = \false, $depth = 512, $options = 0)
269
  {
270
  $data = \json_decode($json, $assoc, $depth, $options);
271
- if (\JSON_ERROR_NONE !== \json_last_error()) {
272
- throw new \InvalidArgumentException('json_decode error: ' . \json_last_error_msg());
 
 
273
  }
 
274
  return $data;
275
  }
 
276
  /**
277
  * Wrapper for JSON encoding that throws when an error occurs.
278
  *
@@ -287,8 +323,11 @@ function json_decode($json, $assoc = \false, $depth = 512, $options = 0)
287
  function json_encode($value, $options = 0, $depth = 512)
288
  {
289
  $json = \json_encode($value, $options, $depth);
290
- if (\JSON_ERROR_NONE !== \json_last_error()) {
291
- throw new \InvalidArgumentException('json_encode error: ' . \json_last_error_msg());
 
 
292
  }
 
293
  return $json;
294
  }
1
  <?php
2
+ namespace GuzzleHttp;
3
 
4
+ use GuzzleHttp\Handler\CurlHandler;
5
+ use GuzzleHttp\Handler\CurlMultiHandler;
6
+ use GuzzleHttp\Handler\Proxy;
7
+ use GuzzleHttp\Handler\StreamHandler;
8
 
 
 
 
 
9
  /**
10
  * Expands a URI template
11
  *
16
  */
17
  function uri_template($template, array $variables)
18
  {
19
+ if (extension_loaded('uri_template')) {
20
  // @codeCoverageIgnoreStart
21
+ return \uri_template($template, $variables);
22
  // @codeCoverageIgnoreEnd
23
  }
24
+
25
  static $uriTemplate;
26
  if (!$uriTemplate) {
27
+ $uriTemplate = new UriTemplate();
28
  }
29
+
30
  return $uriTemplate->expand($template, $variables);
31
  }
32
+
33
  /**
34
  * Debug function used to describe the provided value type and class.
35
  *
40
  */
41
  function describe_type($input)
42
  {
43
+ switch (gettype($input)) {
44
  case 'object':
45
+ return 'object(' . get_class($input) . ')';
46
  case 'array':
47
+ return 'array(' . count($input) . ')';
48
  default:
49
+ ob_start();
50
+ var_dump($input);
51
  // normalize float vs double
52
+ return str_replace('double(', 'float(', rtrim(ob_get_clean()));
53
  }
54
  }
55
+
56
  /**
57
  * Parses an array of header lines into an associative array of headers.
58
  *
63
  function headers_from_lines($lines)
64
  {
65
  $headers = [];
66
+
67
  foreach ($lines as $line) {
68
+ $parts = explode(':', $line, 2);
69
+ $headers[trim($parts[0])][] = isset($parts[1])
70
+ ? trim($parts[1])
71
+ : null;
72
  }
73
+
74
  return $headers;
75
  }
76
+
77
  /**
78
  * Returns a debug stream based on the provided variable.
79
  *
83
  */
84
  function debug_resource($value = null)
85
  {
86
+ if (is_resource($value)) {
87
  return $value;
88
+ } elseif (defined('STDOUT')) {
89
+ return STDOUT;
90
  }
91
+
92
+ return fopen('php://output', 'w');
93
  }
94
+
95
  /**
96
  * Chooses and creates a default handler to use based on the environment.
97
  *
103
  function choose_handler()
104
  {
105
  $handler = null;
106
+ if (function_exists('curl_multi_exec') && function_exists('curl_exec')) {
107
+ $handler = Proxy::wrapSync(new CurlMultiHandler(), new CurlHandler());
108
+ } elseif (function_exists('curl_exec')) {
109
+ $handler = new CurlHandler();
110
+ } elseif (function_exists('curl_multi_exec')) {
111
+ $handler = new CurlMultiHandler();
112
  }
113
+
114
+ if (ini_get('allow_url_fopen')) {
115
+ $handler = $handler
116
+ ? Proxy::wrapStreaming($handler, new StreamHandler())
117
+ : new StreamHandler();
118
  } elseif (!$handler) {
119
+ throw new \RuntimeException('GuzzleHttp requires cURL, the '
120
+ . 'allow_url_fopen ini setting, or a custom HTTP handler.');
121
  }
122
+
123
  return $handler;
124
  }
125
+
126
  /**
127
  * Get the default User-Agent string to use with Guzzle
128
  *
131
  function default_user_agent()
132
  {
133
  static $defaultAgent = '';
134
+
135
  if (!$defaultAgent) {
136
+ $defaultAgent = 'GuzzleHttp/' . Client::VERSION;
137
+ if (extension_loaded('curl') && function_exists('curl_version')) {
138
  $defaultAgent .= ' curl/' . \curl_version()['version'];
139
  }
140
+ $defaultAgent .= ' PHP/' . PHP_VERSION;
141
  }
142
+
143
  return $defaultAgent;
144
  }
145
+
146
  /**
147
  * Returns the default cacert bundle for the current system.
148
  *
177
  'C:\\windows\\system32\\curl-ca-bundle.crt',
178
  'C:\\windows\\curl-ca-bundle.crt',
179
  ];
180
+
181
  if ($cached) {
182
  return $cached;
183
  }
184
+
185
+ if ($ca = ini_get('openssl.cafile')) {
186
  return $cached = $ca;
187
  }
188
+
189
+ if ($ca = ini_get('curl.cainfo')) {
190
  return $cached = $ca;
191
  }
192
+
193
  foreach ($cafiles as $filename) {
194
+ if (file_exists($filename)) {
195
  return $cached = $filename;
196
  }
197
  }
198
+
199
+ throw new \RuntimeException(<<< EOT
200
  No system CA bundle could be found in any of the the common system locations.
201
  PHP versions earlier than 5.6 are not properly configured to use the system's
202
  CA bundle by default. In order to verify peer certificates, you will need to
210
  request option. See http://curl.haxx.se/docs/sslcerts.html for more
211
  information.
212
  EOT
213
+ );
214
  }
215
+
216
  /**
217
  * Creates an associative array of lowercase header names to the actual
218
  * header casing.
224
  function normalize_header_keys(array $headers)
225
  {
226
  $result = [];
227
+ foreach (array_keys($headers) as $key) {
228
+ $result[strtolower($key)] = $key;
229
  }
230
+
231
  return $result;
232
  }
233
+
234
  /**
235
  * Returns true if the provided host matches any of the no proxy areas.
236
  *
252
  */
253
  function is_host_in_noproxy($host, array $noProxyArray)
254
  {
255
+ if (strlen($host) === 0) {
256
  throw new \InvalidArgumentException('Empty host provided');
257
  }
258
+
259
  // Strip port if present.
260
+ if (strpos($host, ':')) {
261
+ $host = explode($host, ':', 2)[0];
262
  }
263
+
264
  foreach ($noProxyArray as $area) {
265
  // Always match on wildcards.
266
  if ($area === '*') {
267
+ return true;
268
  } elseif (empty($area)) {
269
  // Don't match on empty values.
270
  continue;
271
  } elseif ($area === $host) {
272
  // Exact matches.
273
+ return true;
274
  } else {
275
  // Special match if the area when prefixed with ".". Remove any
276
  // existing leading "." and add a new leading ".".
277
+ $area = '.' . ltrim($area, '.');
278
+ if (substr($host, -(strlen($area))) === $area) {
279
+ return true;
280
  }
281
  }
282
  }
283
+
284
+ return false;
285
  }
286
+
287
  /**
288
  * Wrapper for json_decode that throws when an error occurs.
289
  *
297
  * @throws \InvalidArgumentException if the JSON cannot be decoded.
298
  * @link http://www.php.net/manual/en/function.json-decode.php
299
  */
300
+ function json_decode($json, $assoc = false, $depth = 512, $options = 0)
301
  {
302
  $data = \json_decode($json, $assoc, $depth, $options);
303
+ if (JSON_ERROR_NONE !== json_last_error()) {
304
+ throw new \InvalidArgumentException(
305
+ 'json_decode error: ' . json_last_error_msg()
306
+ );
307
  }
308
+
309
  return $data;
310
  }
311
+
312
  /**
313
  * Wrapper for JSON encoding that throws when an error occurs.
314
  *
323
  function json_encode($value, $options = 0, $depth = 512)
324
  {
325
  $json = \json_encode($value, $options, $depth);
326
+ if (JSON_ERROR_NONE !== json_last_error()) {
327
+ throw new \InvalidArgumentException(
328
+ 'json_encode error: ' . json_last_error_msg()
329
+ );
330
  }
331
+
332
  return $json;
333
  }
includes/mollie-api-php/vendor/guzzlehttp/guzzle/src/functions_include.php CHANGED
@@ -1,8 +1,6 @@
1
  <?php
2
 
3
- namespace _PhpScoper5b6804f9734c8;
4
-
5
  // Don't redefine the functions if included multiple times.
6
- if (!\function_exists('_PhpScoper5b6804f9734c8\\GuzzleHttp\\uri_template')) {
7
  require __DIR__ . '/functions.php';
8
  }
1
  <?php
2
 
 
 
3
  // Don't redefine the functions if included multiple times.
4
+ if (!function_exists('GuzzleHttp\uri_template')) {
5
  require __DIR__ . '/functions.php';
6
  }
includes/mollie-api-php/vendor/guzzlehttp/promises/composer.json CHANGED
@@ -1,38 +1,34 @@
1
  {
2
- "name": "guzzlehttp\/promises",
3
  "description": "Guzzle promises library",
4
- "keywords": [
5
- "promise"
6
- ],
7
  "license": "MIT",
8
  "authors": [
9
  {
10
  "name": "Michael Dowling",
11
  "email": "mtdowling@gmail.com",
12
- "homepage": "https:\/\/github.com\/mtdowling"
13
  }
14
  ],
15
  "require": {
16
  "php": ">=5.5.0"
17
  },
18
  "require-dev": {
19
- "phpunit\/phpunit": "^4.0"
20
  },
21
  "autoload": {
22
  "psr-4": {
23
- "_PhpScoper5b6804f9734c8\\GuzzleHttp\\Promise\\": "src\/"
24
  },
25
- "files": [
26
- "src\/functions_include.php"
27
- ]
28
  },
29
  "scripts": {
30
- "test": "vendor\/bin\/phpunit",
31
- "test-ci": "vendor\/bin\/phpunit --coverage-text"
32
  },
33
  "extra": {
34
  "branch-alias": {
35
  "dev-master": "1.4-dev"
36
  }
37
  }
38
- }
1
  {
2
+ "name": "guzzlehttp/promises",
3
  "description": "Guzzle promises library",
4
+ "keywords": ["promise"],
 
 
5
  "license": "MIT",
6
  "authors": [
7
  {
8
  "name": "Michael Dowling",
9
  "email": "mtdowling@gmail.com",
10
+ "homepage": "https://github.com/mtdowling"
11
  }
12
  ],
13
  "require": {
14
  "php": ">=5.5.0"
15
  },
16
  "require-dev": {
17
+ "phpunit/phpunit": "^4.0"
18
  },
19
  "autoload": {
20
  "psr-4": {
21
+ "GuzzleHttp\\Promise\\": "src/"
22
  },
23
+ "files": ["src/functions_include.php"]
 
 
24
  },
25
  "scripts": {
26
+ "test": "vendor/bin/phpunit",
27
+ "test-ci": "vendor/bin/phpunit --coverage-text"
28
  },
29
  "extra": {
30
  "branch-alias": {
31
  "dev-master": "1.4-dev"
32
  }
33
  }
34
+ }
includes/mollie-api-php/vendor/guzzlehttp/promises/src/AggregateException.php CHANGED
@@ -1,14 +1,16 @@
1
  <?php
2
-
3
- namespace _PhpScoper5b6804f9734c8\GuzzleHttp\Promise;
4
 
5
  /**
6
  * Exception thrown when too many errors occur in the some() or any() methods.
7
  */
8
- class AggregateException extends \_PhpScoper5b6804f9734c8\GuzzleHttp\Promise\RejectionException
9
  {
10
  public function __construct($msg, array $reasons)
11
  {
12
- parent::__construct($reasons, \sprintf('%s; %d rejected promises', $msg, \count($reasons)));
 
 
 
13
  }
14
  }
1
  <?php
2
+ namespace GuzzleHttp\Promise;
 
3
 
4
  /**
5
  * Exception thrown when too many errors occur in the some() or any() methods.
6
  */
7
+ class AggregateException extends RejectionException
8
  {
9
  public function __construct($msg, array $reasons)
10
  {
11
+ parent::__construct(
12
+ $reasons,
13
+ sprintf('%s; %d rejected promises', $msg, count($reasons))
14
+ );
15
  }
16
  }
includes/mollie-api-php/vendor/guzzlehttp/promises/src/CancellationException.php CHANGED
@@ -1,10 +1,9 @@
1
  <?php
2
-
3
- namespace _PhpScoper5b6804f9734c8\GuzzleHttp\Promise;
4
 
5
  /**
6
  * Exception that is set as the reason for a promise that has been cancelled.
7
  */
8
- class CancellationException extends \_PhpScoper5b6804f9734c8\GuzzleHttp\Promise\RejectionException
9
  {
10
  }
1
  <?php
2
+ namespace GuzzleHttp\Promise;
 
3
 
4
  /**
5
  * Exception that is set as the reason for a promise that has been cancelled.
6
  */
7
+ class CancellationException extends RejectionException
8
  {
9
  }
includes/mollie-api-php/vendor/guzzlehttp/promises/src/Coroutine.php CHANGED
@@ -1,10 +1,10 @@
1
  <?php
2
-
3
- namespace _PhpScoper5b6804f9734c8\GuzzleHttp\Promise;
4
 
5
  use Exception;
6
  use Generator;
7
  use Throwable;
 
8
  /**
9
  * Creates a promise that is resolved using a generator that yields values or
10
  * promises (somewhat similar to C#'s async keyword).
@@ -40,63 +40,78 @@ use Throwable;
40
  * @return Promise
41
  * @link https://github.com/petkaantonov/bluebird/blob/master/API.md#generators inspiration
42
  */
43
- final class Coroutine implements \_PhpScoper5b6804f9734c8\GuzzleHttp\Promise\PromiseInterface
44
  {
45
  /**
46
  * @var PromiseInterface|null
47
  */
48
  private $currentPromise;
 
49
  /**
50
  * @var Generator
51
  */
52
  private $generator;
 
53
  /**
54
  * @var Promise
55
  */
56
  private $result;
 
57
  public function __construct(callable $generatorFn)
58
  {
59
  $this->generator = $generatorFn();
60
- $this->result = new \_PhpScoper5b6804f9734c8\GuzzleHttp\Promise\Promise(function () {
61
  while (isset($this->currentPromise)) {
62
  $this->currentPromise->wait();
63
  }
64
  });
65
  $this->nextCoroutine($this->generator->current());
66
  }
67
- public function then(callable $onFulfilled = null, callable $onRejected = null)
68
- {
 
 
 
69
  return $this->result->then($onFulfilled, $onRejected);
70
  }
 
71
  public function otherwise(callable $onRejected)
72
  {
73
  return $this->result->otherwise($onRejected);
74
  }
75
- public function wait($unwrap = \true)
 
76
  {
77
  return $this->result->wait($unwrap);
78
  }
 
79
  public function getState()
80
  {
81
  return $this->result->getState();
82
  }
 
83
  public function resolve($value)
84
  {
85
  $this->result->resolve($value);
86
  }
 
87
  public function reject($reason)
88
  {
89
  $this->result->reject($reason);
90
  }
 
91
  public function cancel()
92
  {
93
  $this->currentPromise->cancel();
94
  $this->result->cancel();
95
  }
 
96
  private function nextCoroutine($yielded)
97
  {
98
- $this->currentPromise = promise_for($yielded)->then([$this, '_handleSuccess'], [$this, '_handleFailure']);
 
99
  }
 
100
  /**
101
  * @internal
102
  */
@@ -110,12 +125,13 @@ final class Coroutine implements \_PhpScoper5b6804f9734c8\GuzzleHttp\Promise\Pro
110
  } else {
111
  $this->result->resolve($value);
112
  }
113
- } catch (\Exception $exception) {
114
  $this->result->reject($exception);
115
- } catch (\Throwable $throwable) {
116
  $this->result->reject($throwable);
117
  }
118
  }
 
119
  /**
120
  * @internal
121
  */
@@ -126,9 +142,9 @@ final class Coroutine implements \_PhpScoper5b6804f9734c8\GuzzleHttp\Promise\Pro
126
  $nextYield = $this->generator->throw(exception_for($reason));
127
  // The throw was caught, so keep iterating on the coroutine
128
  $this->nextCoroutine($nextYield);
129
- } catch (\Exception $exception) {
130
  $this->result->reject($exception);
131
- } catch (\Throwable $throwable) {
132
  $this->result->reject($throwable);
133
  }
134
  }
1
  <?php
2
+ namespace GuzzleHttp\Promise;
 
3
 
4
  use Exception;
5
  use Generator;
6
  use Throwable;
7
+
8
  /**
9
  * Creates a promise that is resolved using a generator that yields values or
10
  * promises (somewhat similar to C#'s async keyword).
40
  * @return Promise
41
  * @link https://github.com/petkaantonov/bluebird/blob/master/API.md#generators inspiration
42
  */
43
+ final class Coroutine implements PromiseInterface
44
  {
45
  /**
46
  * @var PromiseInterface|null
47
  */
48
  private $currentPromise;
49
+
50
  /**
51
  * @var Generator
52
  */
53
  private $generator;
54
+
55
  /**
56
  * @var Promise
57
  */
58
  private $result;
59
+
60
  public function __construct(callable $generatorFn)
61
  {
62
  $this->generator = $generatorFn();
63
+ $this->result = new Promise(function () {
64
  while (isset($this->currentPromise)) {
65
  $this->currentPromise->wait();
66
  }
67
  });
68
  $this->nextCoroutine($this->generator->current());
69
  }
70
+
71
+ public function then(
72
+ callable $onFulfilled = null,
73
+ callable $onRejected = null
74
+ ) {
75
  return $this->result->then($onFulfilled, $onRejected);
76
  }
77
+
78
  public function otherwise(callable $onRejected)
79
  {
80
  return $this->result->otherwise($onRejected);
81
  }
82
+
83
+ public function wait($unwrap = true)
84
  {
85
  return $this->result->wait($unwrap);
86
  }
87
+
88
  public function getState()
89
  {
90
  return $this->result->getState();
91
  }
92
+
93
  public function resolve($value)
94
  {
95
  $this->result->resolve($value);
96
  }
97
+
98
  public function reject($reason)
99
  {
100
  $this->result->reject($reason);
101
  }
102
+
103
  public function cancel()
104
  {
105
  $this->currentPromise->cancel();
106
  $this->result->cancel();
107
  }
108
+
109
  private function nextCoroutine($yielded)
110
  {
111
+ $this->currentPromise = promise_for($yielded)
112
+ ->then([$this, '_handleSuccess'], [$this, '_handleFailure']);
113
  }
114
+
115
  /**
116
  * @internal
117
  */
125
  } else {
126
  $this->result->resolve($value);
127
  }
128
+ } catch (Exception $exception) {
129
  $this->result->reject($exception);
130
+ } catch (Throwable $throwable) {
131
  $this->result->reject($throwable);
132
  }
133
  }
134
+
135
  /**
136
  * @internal
137
  */
142
  $nextYield = $this->generator->throw(exception_for($reason));
143
  // The throw was caught, so keep iterating on the coroutine
144
  $this->nextCoroutine($nextYield);
145
+ } catch (Exception $exception) {
146
  $this->result->reject($exception);
147
+ } catch (Throwable $throwable) {
148
  $this->result->reject($throwable);
149
  }
150
  }
includes/mollie-api-php/vendor/guzzlehttp/promises/src/EachPromise.php CHANGED
@@ -1,26 +1,32 @@
1
  <?php
2
-
3
- namespace _PhpScoper5b6804f9734c8\GuzzleHttp\Promise;
4
 
5
  /**
6
  * Represents a promise that iterates over many promises and invokes
7
  * side-effect functions in the process.
8
  */
9
- class EachPromise implements \_PhpScoper5b6804f9734c8\GuzzleHttp\Promise\PromisorInterface
10
  {
11
  private $pending = [];
 
12
  /** @var \Iterator */
13
  private $iterable;
 
14
  /** @var callable|int */
15
  private $concurrency;
 
16
  /** @var callable */
17
  private $onFulfilled;
 
18
  /** @var callable */
19
  private $onRejected;
 
20
  /** @var Promise */
21
  private $aggregate;
 
22
  /** @var bool */
23
  private $mutex;
 
24
  /**
25
  * Configuration hash can include the following key value pairs:
26
  *
@@ -45,21 +51,26 @@ class EachPromise implements \_PhpScoper5b6804f9734c8\GuzzleHttp\Promise\Promiso
45
  public function __construct($iterable, array $config = [])
46
  {
47
  $this->iterable = iter_for($iterable);
 
48
  if (isset($config['concurrency'])) {
49
  $this->concurrency = $config['concurrency'];
50
  }
 
51
  if (isset($config['fulfilled'])) {
52
  $this->onFulfilled = $config['fulfilled'];
53
  }
 
54
  if (isset($config['rejected'])) {
55
  $this->onRejected = $config['rejected'];
56
  }
57
  }
 
58
  public function promise()
59
  {
60
  if ($this->aggregate) {
61
  return $this->aggregate;
62
  }
 
63
  try {
64
  $this->createPromise();
65
  $this->iterable->rewind();
@@ -69,45 +80,53 @@ class EachPromise implements \_PhpScoper5b6804f9734c8\GuzzleHttp\Promise\Promiso
69
  } catch (\Exception $e) {
70
  $this->aggregate->reject($e);
71
  }
 
72
  return $this->aggregate;
73
  }
 
74
  private function createPromise()
75
  {
76
- $this->mutex = \false;
77
- $this->aggregate = new \_PhpScoper5b6804f9734c8\GuzzleHttp\Promise\Promise(function () {
78
- \reset($this->pending);
79
  if (empty($this->pending) && !$this->iterable->valid()) {
80
  $this->aggregate->resolve(null);
81
  return;
82
  }
 
83
  // Consume a potentially fluctuating list of promises while
84
  // ensuring that indexes are maintained (precluding array_shift).
85
- while ($promise = \current($this->pending)) {
86
- \next($this->pending);
87
  $promise->wait();
88
- if ($this->aggregate->getState() !== \_PhpScoper5b6804f9734c8\GuzzleHttp\Promise\PromiseInterface::PENDING) {
89
  return;
90
  }
91
  }
92
  });
 
93
  // Clear the references when the promise is resolved.
94
  $clearFn = function () {
95
  $this->iterable = $this->concurrency = $this->pending = null;
96
  $this->onFulfilled = $this->onRejected = null;
97
  };
 
98
  $this->aggregate->then($clearFn, $clearFn);
99
  }
 
100
  private function refillPending()
101
  {
102
  if (!$this->concurrency) {
103
  // Add all pending promises.
104
- while ($this->addPending() && $this->advanceIterator()) {
105
- }
106
  return;
107
  }
 
108
  // Add only up to N pending promises.
109
- $concurrency = \is_callable($this->concurrency) ? \call_user_func($this->concurrency, \count($this->pending)) : $this->concurrency;
110
- $concurrency = \max($concurrency - \count($this->pending), 0);
 
 
111
  // Concurrency may be set to 0 to disallow new promises.
112
  if (!$concurrency) {
113
  return;
@@ -118,58 +137,76 @@ class EachPromise implements \_PhpScoper5b6804f9734c8\GuzzleHttp\Promise\Promiso
118
  // not advance the iterator after adding the first promise. This
119
  // helps work around issues with generators that might not have the
120
  // next value to yield until promise callbacks are called.
121
- while (--$concurrency && $this->advanceIterator() && $this->addPending()) {
122
- }
 
123
  }
 
124
  private function addPending()
125
  {
126
  if (!$this->iterable || !$this->iterable->valid()) {
127
- return \false;
128
  }
 
129
  $promise = promise_for($this->iterable->current());
130
  $idx = $this->iterable->key();
131
- $this->pending[$idx] = $promise->then(function ($value) use($idx) {
132
- if ($this->onFulfilled) {
133
- \call_user_func($this->onFulfilled, $value, $idx, $this->aggregate);
134
- }
135
- $this->step($idx);
136
- }, function ($reason) use($idx) {
137
- if ($this->onRejected) {
138
- \call_user_func($this->onRejected, $reason, $idx, $this->aggregate);
 
 
 
 
 
 
 
 
 
139
  }
140
- $this->step($idx);
141
- });
142
- return \true;
143
  }
 
144
  private function advanceIterator()
145
  {
146
  // Place a lock on the iterator so that we ensure to not recurse,
147
  // preventing fatal generator errors.
148
  if ($this->mutex) {
149
- return \false;
150
  }
151
- $this->mutex = \true;
 
 
152
  try {
153
  $this->iterable->next();
154
- $this->mutex = \false;
155
- return \true;
156
  } catch (\Throwable $e) {
157
  $this->aggregate->reject($e);
158
- $this->mutex = \false;
159
- return \false;
160
  } catch (\Exception $e) {
161
  $this->aggregate->reject($e);
162
- $this->mutex = \false;
163
- return \false;
164
  }
165
  }
 
166
  private function step($idx)
167
  {
168
  // If the promise was already resolved, then ignore this step.
169
- if ($this->aggregate->getState() !== \_PhpScoper5b6804f9734c8\GuzzleHttp\Promise\PromiseInterface::PENDING) {
170
  return;
171
  }
 
172
  unset($this->pending[$idx]);
 
173
  // Only refill pending promises if we are not locked, preventing the
174
  // EachPromise to recursively invoke the provided iterator, which
175
  // cause a fatal error: "Cannot resume an already running generator"
@@ -178,13 +215,15 @@ class EachPromise implements \_PhpScoper5b6804f9734c8\GuzzleHttp\Promise\Promiso
178
  $this->refillPending();
179
  }
180
  }
 
181
  private function checkIfFinished()
182
  {
183
  if (!$this->pending && !$this->iterable->valid()) {
184
  // Resolve the promise if there's nothing left to do.
185
  $this->aggregate->resolve(null);
186
- return \true;
187
  }
188
- return \false;
 
189
  }
190
  }
1
  <?php
2
+ namespace GuzzleHttp\Promise;
 
3
 
4
  /**
5
  * Represents a promise that iterates over many promises and invokes
6
  * side-effect functions in the process.
7
  */
8
+ class EachPromise implements PromisorInterface
9
  {
10
  private $pending = [];
11
+
12
  /** @var \Iterator */
13
  private $iterable;
14
+
15
  /** @var callable|int */
16
  private $concurrency;
17
+
18
  /** @var callable */
19
  private $onFulfilled;
20
+
21
  /** @var callable */
22
  private $onRejected;
23
+
24
  /** @var Promise */
25
  private $aggregate;
26
+
27
  /** @var bool */
28
  private $mutex;
29
+
30
  /**
31
  * Configuration hash can include the following key value pairs:
32
  *
51
  public function __construct($iterable, array $config = [])
52
  {
53
  $this->iterable = iter_for($iterable);
54
+
55
  if (isset($config['concurrency'])) {
56
  $this->concurrency = $config['concurrency'];
57
  }
58
+
59
  if (isset($config['fulfilled'])) {
60
  $this->onFulfilled = $config['fulfilled'];
61
  }
62
+
63
  if (isset($config['rejected'])) {
64
  $this->onRejected = $config['rejected'];
65
  }
66
  }
67
+
68
  public function promise()
69
  {
70
  if ($this->aggregate) {
71
  return $this->aggregate;
72
  }
73
+
74
  try {
75
  $this->createPromise();
76
  $this->iterable->rewind();
80
  } catch (\Exception $e) {
81
  $this->aggregate->reject($e);
82
  }
83
+
84
  return $this->aggregate;
85
  }
86
+
87
  private function createPromise()
88
  {
89
+ $this->mutex = false;
90
+ $this->aggregate = new Promise(function () {
91
+ reset($this->pending);
92
  if (empty($this->pending) && !$this->iterable->valid()) {
93
  $this->aggregate->resolve(null);
94
  return;
95
  }
96
+
97
  // Consume a potentially fluctuating list of promises while
98
  // ensuring that indexes are maintained (precluding array_shift).
99
+ while ($promise = current($this->pending)) {
100
+ next($this->pending);
101
  $promise->wait();
102
+ if ($this->aggregate->getState() !== PromiseInterface::PENDING) {
103
  return;
104
  }
105
  }
106
  });
107
+
108
  // Clear the references when the promise is resolved.
109
  $clearFn = function () {
110
  $this->iterable = $this->concurrency = $this->pending = null;
111
  $this->onFulfilled = $this->onRejected = null;
112
  };
113
+
114
  $this->aggregate->then($clearFn, $clearFn);
115
  }
116
+
117
  private function refillPending()
118
  {
119
  if (!$this->concurrency) {
120
  // Add all pending promises.
121
+ while ($this->addPending() && $this->advanceIterator());
 
122
  return;
123
  }
124
+
125
  // Add only up to N pending promises.
126
+ $concurrency = is_callable($this->concurrency)
127
+ ? call_user_func($this->concurrency, count($this->pending))
128
+ : $this->concurrency;
129
+ $concurrency = max($concurrency - count($this->pending), 0);
130
  // Concurrency may be set to 0 to disallow new promises.
131
  if (!$concurrency) {
132
  return;
137
  // not advance the iterator after adding the first promise. This
138
  // helps work around issues with generators that might not have the
139
  // next value to yield until promise callbacks are called.
140
+ while (--$concurrency
141
+ && $this->advanceIterator()
142
+ && $this->addPending());
143
  }
144
+
145
  private function addPending()
146
  {
147
  if (!$this->iterable || !$this->iterable->valid()) {
148
+ return false;
149
  }
150
+
151
  $promise = promise_for($this->iterable->current());
152
  $idx = $this->iterable->key();
153
+
154
+ $this->pending[$idx] = $promise->then(
155
+ function ($value) use ($idx) {
156
+ if ($this->onFulfilled) {
157
+ call_user_func(
158
+ $this->onFulfilled, $value, $idx, $this->aggregate
159
+ );
160
+ }
161
+ $this->step($idx);
162
+ },
163
+ function ($reason) use ($idx) {
164
+ if ($this->onRejected) {
165
+ call_user_func(
166
+ $this->onRejected, $reason, $idx, $this->aggregate
167
+ );
168
+ }
169
+ $this->step($idx);
170
  }
171
+ );
172
+
173
+ return true;
174
  }
175
+
176
  private function advanceIterator()
177
  {
178
  // Place a lock on the iterator so that we ensure to not recurse,
179
  // preventing fatal generator errors.
180
  if ($this->mutex) {
181
+ return false;
182
  }
183
+
184
+ $this->mutex = true;
185
+
186
  try {
187
  $this->iterable->next();
188
+ $this->mutex = false;
189
+ return true;
190
  } catch (\Throwable $e) {
191
  $this->aggregate->reject($e);
192
+ $this->mutex = false;
193
+ return false;
194
  } catch (\Exception $e) {
195
  $this->aggregate->reject($e);
196
+ $this->mutex = false;
197
+ return false;
198
  }
199
  }
200
+
201
  private function step($idx)
202
  {
203
  // If the promise was already resolved, then ignore this step.
204
+ if ($this->aggregate->getState() !== PromiseInterface::PENDING) {
205
  return;
206
  }
207
+
208
  unset($this->pending[$idx]);
209
+
210
  // Only refill pending promises if we are not locked, preventing the
211
  // EachPromise to recursively invoke the provided iterator, which
212
  // cause a fatal error: "Cannot resume an already running generator"
215
  $this->refillPending();
216
  }
217
  }
218
+
219
  private function checkIfFinished()
220
  {
221
  if (!$this->pending && !$this->iterable->valid()) {
222
  // Resolve the promise if there's nothing left to do.
223
  $this->aggregate->resolve(null);
224
+ return true;
225
  }
226
+
227
+ return false;
228
  }
229
  }
includes/mollie-api-php/vendor/guzzlehttp/promises/src/FulfilledPromise.php CHANGED
@@ -1,6 +1,5 @@
1
  <?php
2
-
3
- namespace _PhpScoper5b6804f9734c8\GuzzleHttp\Promise;
4
 
5
  /**
6
  * A promise that has been fulfilled.
@@ -8,26 +7,33 @@ namespace _PhpScoper5b6804f9734c8\GuzzleHttp\Promise;
8
  * Thenning off of this promise will invoke the onFulfilled callback
9
  * immediately and ignore other callbacks.
10
  */
11
- class FulfilledPromise implements \_PhpScoper5b6804f9734c8\GuzzleHttp\Promise\PromiseInterface
12
  {
13
  private $value;
 
14
  public function __construct($value)
15
  {
16
- if (\method_exists($value, 'then')) {
17
- throw new \InvalidArgumentException('You cannot create a FulfilledPromise with a promise.');
 
18
  }
 
19
  $this->value = $value;
20
  }
21
- public function then(callable $onFulfilled = null, callable $onRejected = null)
22
- {
 
 
 
23
  // Return itself if there is no onFulfilled function.
24
  if (!$onFulfilled) {
25
  return $this;
26
  }
 
27
  $queue = queue();
28
- $p = new \_PhpScoper5b6804f9734c8\GuzzleHttp\Promise\Promise([$queue, 'run']);
29
  $value = $this->value;
30
- $queue->add(static function () use($p, $value, $onFulfilled) {
31
  if ($p->getState() === self::PENDING) {
32
  try {
33
  $p->resolve($onFulfilled($value));
@@ -38,30 +44,37 @@ class FulfilledPromise implements \_PhpScoper5b6804f9734c8\GuzzleHttp\Promise\Pr
38
  }
39
  }
40
  });
 
41
  return $p;
42
  }
 
43
  public function otherwise(callable $onRejected)
44
  {
45
  return $this->then(null, $onRejected);
46
  }
47
- public function wait($unwrap = \true, $defaultDelivery = null)
 
48
  {
49
  return $unwrap ? $this->value : null;
50
  }
 
51
  public function getState()
52
  {
53
  return self::FULFILLED;
54
  }
 
55
  public function resolve($value)
56
  {
57
  if ($value !== $this->value) {
58
  throw new \LogicException("Cannot resolve a fulfilled promise");
59
  }
60
  }
 
61
  public function reject($reason)
62
  {
63
  throw new \LogicException("Cannot reject a fulfilled promise");
64
  }
 
65
  public function cancel()
66
  {
67
  // pass
1
  <?php
2
+ namespace GuzzleHttp\Promise;
 
3
 
4
  /**
5
  * A promise that has been fulfilled.
7
  * Thenning off of this promise will invoke the onFulfilled callback
8
  * immediately and ignore other callbacks.
9
  */
10
+ class FulfilledPromise implements PromiseInterface
11
  {
12
  private $value;
13
+
14
  public function __construct($value)
15
  {
16
+ if (method_exists($value, 'then')) {
17
+ throw new \InvalidArgumentException(
18
+ 'You cannot create a FulfilledPromise with a promise.');
19
  }
20
+
21
  $this->value = $value;
22
  }
23
+
24
+ public function then(
25
+ callable $onFulfilled = null,
26
+ callable $onRejected = null
27
+ ) {
28
  // Return itself if there is no onFulfilled function.
29
  if (!$onFulfilled) {
30
  return $this;
31
  }
32
+
33
  $queue = queue();
34
+ $p = new Promise([$queue, 'run']);
35
  $value = $this->value;
36
+ $queue->add(static function () use ($p, $value, $onFulfilled) {
37
  if ($p->getState() === self::PENDING) {
38
  try {
39
  $p->resolve($onFulfilled($value));
44
  }
45
  }
46
  });
47
+
48
  return $p;
49
  }
50
+
51
  public function otherwise(callable $onRejected)
52
  {
53
  return $this->then(null, $onRejected);
54
  }
55
+
56
+ public function wait($unwrap = true, $defaultDelivery = null)
57
  {
58
  return $unwrap ? $this->value : null;
59
  }
60
+
61
  public function getState()
62
  {
63
  return self::FULFILLED;
64
  }
65
+
66
  public function resolve($value)
67
  {
68
  if ($value !== $this->value) {
69
  throw new \LogicException("Cannot resolve a fulfilled promise");
70
  }
71
  }
72
+
73
  public function reject($reason)
74
  {
75
  throw new \LogicException("Cannot reject a fulfilled promise");
76
  }
77
+
78
  public function cancel()
79
  {
80
  // pass
includes/mollie-api-php/vendor/guzzlehttp/promises/src/Promise.php CHANGED
@@ -1,13 +1,12 @@
1
  <?php
2
-
3
- namespace _PhpScoper5b6804f9734c8\GuzzleHttp\Promise;
4
 
5
  /**
6
  * Promises/A+ implementation that avoids recursion when possible.
7
  *
8
  * @link https://promisesaplus.com/
9
  */
10
- class Promise implements \_PhpScoper5b6804f9734c8\GuzzleHttp\Promise\PromiseInterface
11
  {
12
  private $state = self::PENDING;
13
  private $result;
@@ -15,43 +14,61 @@ class Promise implements \_PhpScoper5b6804f9734c8\GuzzleHttp\Promise\PromiseInte
15
  private $waitFn;
16
  private $waitList;
17
  private $handlers = [];
 
18
  /**
19
  * @param callable $waitFn Fn that when invoked resolves the promise.
20
  * @param callable $cancelFn Fn that when invoked cancels the promise.
21
  */
22
- public function __construct(callable $waitFn = null, callable $cancelFn = null)
23
- {
 
 
24
  $this->waitFn = $waitFn;
25
  $this->cancelFn = $cancelFn;
26
  }
27
- public function then(callable $onFulfilled = null, callable $onRejected = null)
28
- {
 
 
 
29
  if ($this->state === self::PENDING) {
30
- $p = new \_PhpScoper5b6804f9734c8\GuzzleHttp\Promise\Promise(null, [$this, 'cancel']);
31
  $this->handlers[] = [$p, $onFulfilled, $onRejected];
32
  $p->waitList = $this->waitList;
33
  $p->waitList[] = $this;
34
  return $p;
35
  }
 
36
  // Return a fulfilled promise and immediately invoke any callbacks.
37
  if ($this->state === self::FULFILLED) {
38
- return $onFulfilled ? promise_for($this->result)->then($onFulfilled) : promise_for($this->result);
 
 
39
  }
 
40
  // It's either cancelled or rejected, so return a rejected promise
41
  // and immediately invoke any callbacks.
42
  $rejection = rejection_for($this->result);
43
  return $onRejected ? $rejection->then(null, $onRejected) : $rejection;
44
  }
 
45
  public function otherwise(callable $onRejected)
46
  {
47
  return $this->then(null, $onRejected);
48
  }
49
- public function wait($unwrap = \true)
 
50
  {
51
  $this->waitIfPending();
52
- $inner = $this->result instanceof \_PhpScoper5b6804f9734c8\GuzzleHttp\Promise\PromiseInterface ? $this->result->wait($unwrap) : $this->result;
 
 
 
 
53
  if ($unwrap) {
54
- if ($this->result instanceof \_PhpScoper5b6804f9734c8\GuzzleHttp\Promise\PromiseInterface || $this->state === self::FULFILLED) {
 
 
55
  return $inner;
56
  } else {
57
  // It's rejected so "unwrap" and throw an exception.
@@ -59,16 +76,20 @@ class Promise implements \_PhpScoper5b6804f9734c8\GuzzleHttp\Promise\PromiseInte
59
  }
60
  }
61
  }
 
62
  public function getState()
63
  {
64
  return $this->state;
65
  }
 
66
  public function cancel()
67
  {
68
  if ($this->state !== self::PENDING) {
69
  return;
70
  }
 
71
  $this->waitFn = $this->waitList = null;
 
72
  if ($this->cancelFn) {
73
  $fn = $this->cancelFn;
74
  $this->cancelFn = null;
@@ -80,19 +101,23 @@ class Promise implements \_PhpScoper5b6804f9734c8\GuzzleHttp\Promise\PromiseInte
80
  $this->reject($e);
81
  }
82
  }
 
83
  // Reject the promise only if it wasn't rejected in a then callback.
84
  if ($this->state === self::PENDING) {
85
- $this->reject(new \_PhpScoper5b6804f9734c8\GuzzleHttp\Promise\CancellationException('Promise has been cancelled'));
86
  }
87
  }
 
88
  public function resolve($value)
89
  {
90
  $this->settle(self::FULFILLED, $value);
91
  }
 
92
  public function reject($reason)
93
  {
94
  $this->settle(self::REJECTED, $reason);
95
  }
 
96
  private function settle($state, $value)
97
  {
98
  if ($this->state !== self::PENDING) {
@@ -100,11 +125,15 @@ class Promise implements \_PhpScoper5b6804f9734c8\GuzzleHttp\Promise\PromiseInte
100
  if ($state === $this->state && $value === $this->result) {
101
  return;
102
  }
103
- throw $this->state === $state ? new \LogicException("The promise is already {$state}.") : new \LogicException("Cannot change a {$this->state} promise to {$state}");
 
 
104
  }
 
105
  if ($value === $this) {
106
  throw new \LogicException('Cannot fulfill or reject a promise with itself');
107
  }
 
108
  // Clear out the state of the promise but stash the handlers.
109
  $this->state = $state;
110
  $this->result = $value;
@@ -112,35 +141,43 @@ class Promise implements \_PhpScoper5b6804f9734c8\GuzzleHttp\Promise\PromiseInte
112
  $this->handlers = null;
113
  $this->waitList = $this->waitFn = null;
114
  $this->cancelFn = null;
 
115
  if (!$handlers) {
116
  return;
117
  }
 
118
  // If the value was not a settled promise or a thenable, then resolve
119
  // it in the task queue using the correct ID.
120
- if (!\method_exists($value, 'then')) {
121
  $id = $state === self::FULFILLED ? 1 : 2;
122
  // It's a success, so resolve the handlers in the queue.
123
- queue()->add(static function () use($id, $value, $handlers) {
124
  foreach ($handlers as $handler) {
125
  self::callHandler($id, $value, $handler);
126
  }
127
  });
128
- } elseif ($value instanceof \_PhpScoper5b6804f9734c8\GuzzleHttp\Promise\Promise && $value->getState() === self::PENDING) {
 
 
129
  // We can just merge our handlers onto the next promise.
130
- $value->handlers = \array_merge($value->handlers, $handlers);
131
  } else {
132
  // Resolve the handlers when the forwarded promise is resolved.
133
- $value->then(static function ($value) use($handlers) {
134
- foreach ($handlers as $handler) {
135
- self::callHandler(1, $value, $handler);
136
- }
137
- }, static function ($reason) use($handlers) {
138
- foreach ($handlers as $handler) {
139
- self::callHandler(2, $reason, $handler);
 
 
 
140
  }
141
- });
142
  }
143
  }
 
144
  /**
145
  * Call a stack of handlers using a specific callback index and value.
146
  *
@@ -154,11 +191,13 @@ class Promise implements \_PhpScoper5b6804f9734c8\GuzzleHttp\Promise\PromiseInte
154
  {
155
  /** @var PromiseInterface $promise */
156
  $promise = $handler[0];
 
157
  // The promise may have been cancelled or resolved before placing
158
  // this thunk in the queue.
159
  if ($promise->getState() !== self::PENDING) {
160
  return;
161
  }
 
162
  try {
163
  if (isset($handler[$index])) {
164
  $promise->resolve($handler[$index]($value));
@@ -175,6 +214,7 @@ class Promise implements \_PhpScoper5b6804f9734c8\GuzzleHttp\Promise\PromiseInte
175
  $promise->reject($reason);
176
  }
177
  }
 
178
  private function waitIfPending()
179
  {
180
  if ($this->state !== self::PENDING) {
@@ -185,19 +225,25 @@ class Promise implements \_PhpScoper5b6804f9734c8\GuzzleHttp\Promise\PromiseInte
185
  $this->invokeWaitList();
186
  } else {
187
  // If there's not wait function, then reject the promise.
188
- $this->reject('Cannot wait on a promise that has ' . 'no internal wait function. You must provide a wait ' . 'function when constructing the promise to be able to ' . 'wait on a promise.');
 
 
 
189
  }
 
190
  queue()->run();
 
191
  if ($this->state === self::PENDING) {
192
  $this->reject('Invoking the wait callback did not resolve the promise');
193
  }
194
  }
 
195
  private function invokeWaitFn()
196
  {
197
  try {
198
  $wfn = $this->waitFn;
199
  $this->waitFn = null;
200
- $wfn(\true);
201
  } catch (\Exception $reason) {
202
  if ($this->state === self::PENDING) {
203
  // The promise has not been resolved yet, so reject the promise
@@ -210,18 +256,21 @@ class Promise implements \_PhpScoper5b6804f9734c8\GuzzleHttp\Promise\PromiseInte
210
  }
211
  }
212
  }
 
213
  private function invokeWaitList()
214
  {
215
  $waitList = $this->waitList;
216
  $this->waitList = null;
 
217
  foreach ($waitList as $result) {
218
- while (\true) {
219
  $result->waitIfPending();
220
- if ($result->result instanceof \_PhpScoper5b6804f9734c8\GuzzleHttp\Promise\Promise) {
 
221
  $result = $result->result;
222
  } else {
223
- if ($result->result instanceof \_PhpScoper5b6804f9734c8\GuzzleHttp\Promise\PromiseInterface) {
224
- $result->result->wait(\false);
225
  }
226
  break;
227
  }
1
  <?php
2
+ namespace GuzzleHttp\Promise;
 
3
 
4
  /**
5
  * Promises/A+ implementation that avoids recursion when possible.
6
  *
7
  * @link https://promisesaplus.com/
8
  */
9
+ class Promise implements PromiseInterface
10
  {
11
  private $state = self::PENDING;
12
  private $result;
14
  private $waitFn;
15
  private $waitList;
16
  private $handlers = [];
17
+
18
  /**
19
  * @param callable $waitFn Fn that when invoked resolves the promise.
20
  * @param callable $cancelFn Fn that when invoked cancels the promise.
21
  */
22
+ public function __construct(
23
+ callable $waitFn = null,
24
+ callable $cancelFn = null
25
+ ) {
26
  $this->waitFn = $waitFn;
27
  $this->cancelFn = $cancelFn;
28
  }
29
+
30
+ public function then(
31
+ callable $onFulfilled = null,
32
+ callable $onRejected = null
33
+ ) {
34
  if ($this->state === self::PENDING) {
35
+ $p = new Promise(null, [$this, 'cancel']);
36
  $this->handlers[] = [$p, $onFulfilled, $onRejected];
37
  $p->waitList = $this->waitList;
38
  $p->waitList[] = $this;
39
  return $p;
40
  }
41
+
42
  // Return a fulfilled promise and immediately invoke any callbacks.
43
  if ($this->state === self::FULFILLED) {
44
+ return $onFulfilled
45
+ ? promise_for($this->result)->then($onFulfilled)
46
+ : promise_for($this->result);
47
  }
48
+
49
  // It's either cancelled or rejected, so return a rejected promise
50
  // and immediately invoke any callbacks.
51
  $rejection = rejection_for($this->result);
52
  return $onRejected ? $rejection->then(null, $onRejected) : $rejection;
53
  }
54
+
55
  public function otherwise(callable $onRejected)
56
  {
57
  return $this->then(null, $onRejected);
58
  }
59
+
60
+ public function wait($unwrap = true)
61
  {
62
  $this->waitIfPending();
63
+
64
+ $inner = $this->result instanceof PromiseInterface
65
+ ? $this->result->wait($unwrap)
66
+ : $this->result;
67
+
68
  if ($unwrap) {
69
+ if ($this->result instanceof PromiseInterface
70
+ || $this->state === self::FULFILLED
71
+ ) {
72
  return $inner;
73
  } else {
74
  // It's rejected so "unwrap" and throw an exception.
76
  }
77
  }
78
  }
79
+
80
  public function getState()
81
  {
82
  return $this->state;
83
  }
84
+
85
  public function cancel()
86
  {
87
  if ($this->state !== self::PENDING) {
88
  return;
89
  }
90
+
91
  $this->waitFn = $this->waitList = null;
92
+
93
  if ($this->cancelFn) {
94
  $fn = $this->cancelFn;
95
  $this->cancelFn = null;
101
  $this->reject($e);
102
  }
103
  }
104
+
105
  // Reject the promise only if it wasn't rejected in a then callback.
106
  if ($this->state === self::PENDING) {
107
+ $this->reject(new CancellationException('Promise has been cancelled'));
108
  }
109
  }
110
+
111
  public function resolve($value)
112
  {
113
  $this->settle(self::FULFILLED, $value);
114
  }
115
+
116
  public function reject($reason)
117
  {
118
  $this->settle(self::REJECTED, $reason);
119
  }
120
+
121
  private function settle($state, $value)
122
  {
123
  if ($this->state !== self::PENDING) {
125
  if ($state === $this->state && $value === $this->result) {
126
  return;
127
  }
128
+ throw $this->state === $state
129
+ ? new \LogicException("The promise is already {$state}.")
130
+ : new \LogicException("Cannot change a {$this->state} promise to {$state}");
131
  }
132
+
133
  if ($value === $this) {
134
  throw new \LogicException('Cannot fulfill or reject a promise with itself');
135
  }
136
+
137
  // Clear out the state of the promise but stash the handlers.
138
  $this->state = $state;
139
  $this->result = $value;
141
  $this->handlers = null;
142
  $this->waitList = $this->waitFn = null;
143
  $this->cancelFn = null;
144
+
145
  if (!$handlers) {
146
  return;
147
  }
148
+
149
  // If the value was not a settled promise or a thenable, then resolve
150
  // it in the task queue using the correct ID.
151
+ if (!method_exists($value, 'then')) {
152
  $id = $state === self::FULFILLED ? 1 : 2;
153
  // It's a success, so resolve the handlers in the queue.
154
+ queue()->add(static function () use ($id, $value, $handlers) {
155
  foreach ($handlers as $handler) {
156
  self::callHandler($id, $value, $handler);
157
  }
158
  });
159
+ } elseif ($value instanceof Promise
160
+ && $value->getState() === self::PENDING
161
+ ) {
162
  // We can just merge our handlers onto the next promise.
163
+ $value->handlers = array_merge($value->handlers, $handlers);
164
  } else {
165
  // Resolve the handlers when the forwarded promise is resolved.
166
+ $value->then(
167
+ static function ($value) use ($handlers) {
168
+ foreach ($handlers as $handler) {
169
+ self::callHandler(1, $value, $handler);
170
+ }
171
+ },
172
+ static function ($reason) use ($handlers) {
173
+ foreach ($handlers as $handler) {
174
+ self::callHandler(2, $reason, $handler);
175
+ }
176
  }
177
+ );
178
  }
179
  }
180
+
181
  /**
182
  * Call a stack of handlers using a specific callback index and value.
183
  *
191
  {
192
  /** @var PromiseInterface $promise */
193
  $promise = $handler[0];
194
+
195
  // The promise may have been cancelled or resolved before placing
196
  // this thunk in the queue.
197
  if ($promise->getState() !== self::PENDING) {
198
  return;
199
  }
200
+
201
  try {
202
  if (isset($handler[$index])) {
203
  $promise->resolve($handler[$index]($value));
214
  $promise->reject($reason);
215
  }
216
  }
217
+
218
  private function waitIfPending()
219
  {
220
  if ($this->state !== self::PENDING) {
225
  $this->invokeWaitList();
226
  } else {
227
  // If there's not wait function, then reject the promise.
228
+ $this->reject('Cannot wait on a promise that has '
229
+ . 'no internal wait function. You must provide a wait '
230
+ . 'function when constructing the promise to be able to '
231
+ . 'wait on a promise.');
232
  }
233
+
234
  queue()->run();
235
+
236
  if ($this->state === self::PENDING) {
237
  $this->reject('Invoking the wait callback did not resolve the promise');
238
  }
239
  }
240
+
241
  private function invokeWaitFn()
242
  {
243
  try {
244
  $wfn = $this->waitFn;
245
  $this->waitFn = null;
246
+ $wfn(true);
247
  } catch (\Exception $reason) {
248
  if ($this->state === self::PENDING) {
249
  // The promise has not been resolved yet, so reject the promise
256
  }
257
  }
258
  }
259
+
260
  private function invokeWaitList()
261
  {
262
  $waitList = $this->waitList;
263
  $this->waitList = null;
264
+
265
  foreach ($waitList as $result) {
266
+ while (true) {
267
  $result->waitIfPending();
268
+
269
+ if ($result->result instanceof Promise) {
270
  $result = $result->result;
271
  } else {
272
+ if ($result->result instanceof PromiseInterface) {
273
+ $result->result->wait(false);
274
  }
275
  break;
276
  }
includes/mollie-api-php/vendor/guzzlehttp/promises/src/PromiseInterface.php CHANGED
@@ -1,6 +1,5 @@
1
  <?php
2
-
3
- namespace _PhpScoper5b6804f9734c8\GuzzleHttp\Promise;
4
 
5
  /**
6
  * A promise represents the eventual result of an asynchronous operation.
@@ -16,6 +15,7 @@ interface PromiseInterface
16
  const PENDING = 'pending';
17
  const FULFILLED = 'fulfilled';
18
  const REJECTED = 'rejected';
 
19
  /**
20
  * Appends fulfillment and rejection handlers to the promise, and returns
21
  * a new promise resolving to the return value of the called handler.
@@ -25,7 +25,11 @@ interface PromiseInterface
25
  *
26
  * @return PromiseInterface
27
  */
28
- public function then(callable $onFulfilled = null, callable $onRejected = null);
 
 
 
 
29
  /**
30
  * Appends a rejection handler callback to the promise, and returns a new
31
  * promise resolving to the return value of the callback if it is called,
@@ -37,6 +41,7 @@ interface PromiseInterface
37
  * @return PromiseInterface
38
  */
39
  public function otherwise(callable $onRejected);
 
40
  /**
41
  * Get the state of the promise ("pending", "rejected", or "fulfilled").
42
  *
@@ -46,6 +51,7 @@ interface PromiseInterface
46
  * @return string
47
  */
48
  public function getState();
 
49
  /**
50
  * Resolve the promise with the given value.
51
  *
@@ -53,6 +59,7 @@ interface PromiseInterface
53
  * @throws \RuntimeException if the promise is already resolved.
54
  */
55
  public function resolve($value);
 
56
  /**
57
  * Reject the promise with the given reason.
58
  *
@@ -60,12 +67,14 @@ interface PromiseInterface
60
  * @throws \RuntimeException if the promise is already resolved.
61
  */
62
  public function reject($reason);
 
63
  /**
64
  * Cancels the promise if possible.
65
  *
66
  * @link https://github.com/promises-aplus/cancellation-spec/issues/7
67
  */
68
  public function cancel();
 
69
  /**
70
  * Waits until the promise completes if possible.
71
  *
@@ -80,5 +89,5 @@ interface PromiseInterface
80
  * @throws \LogicException if the promise has no wait function or if the
81
  * promise does not settle after waiting.
82
  */
83
- public function wait($unwrap = \true);
84
  }
1
  <?php
2
+ namespace GuzzleHttp\Promise;
 
3
 
4
  /**
5
  * A promise represents the eventual result of an asynchronous operation.
15
  const PENDING = 'pending';
16
  const FULFILLED = 'fulfilled';
17
  const REJECTED = 'rejected';
18
+
19
  /**
20
  * Appends fulfillment and rejection handlers to the promise, and returns
21
  * a new promise resolving to the return value of the called handler.
25
  *
26
  * @return PromiseInterface
27
  */
28
+ public function then(
29
+ callable $onFulfilled = null,
30
+ callable $onRejected = null
31
+ );
32
+
33
  /**
34
  * Appends a rejection handler callback to the promise, and returns a new
35
  * promise resolving to the return value of the callback if it is called,
41
  * @return PromiseInterface
42
  */
43
  public function otherwise(callable $onRejected);
44
+
45
  /**
46
  * Get the state of the promise ("pending", "rejected", or "fulfilled").
47
  *
51
  * @return string
52
  */
53
  public function getState();
54
+
55
  /**
56
  * Resolve the promise with the given value.
57
  *
59
  * @throws \RuntimeException if the promise is already resolved.
60
  */
61
  public function resolve($value);
62
+
63
  /**
64
  * Reject the promise with the given reason.
65
  *
67
  * @throws \RuntimeException if the promise is already resolved.
68
  */
69
  public function reject($reason);
70
+
71
  /**
72
  * Cancels the promise if possible.
73
  *
74
  * @link https://github.com/promises-aplus/cancellation-spec/issues/7
75
  */
76
  public function cancel();
77
+
78
  /**
79
  * Waits until the promise completes if possible.
80
  *
89
  * @throws \LogicException if the promise has no wait function or if the
90
  * promise does not settle after waiting.
91
  */
92
+ public function wait($unwrap = true);
93
  }
includes/mollie-api-php/vendor/guzzlehttp/promises/src/PromisorInterface.php CHANGED
@@ -1,6 +1,5 @@
1
  <?php
2
-
3
- namespace _PhpScoper5b6804f9734c8\GuzzleHttp\Promise;
4
 
5
  /**
6
  * Interface used with classes that return a promise.
1
  <?php
2
+ namespace GuzzleHttp\Promise;
 
3
 
4
  /**
5
  * Interface used with classes that return a promise.
includes/mollie-api-php/vendor/guzzlehttp/promises/src/RejectedPromise.php CHANGED
@@ -1,6 +1,5 @@
1
  <?php
2
-
3
- namespace _PhpScoper5b6804f9734c8\GuzzleHttp\Promise;
4
 
5
  /**
6
  * A promise that has been rejected.
@@ -8,26 +7,33 @@ namespace _PhpScoper5b6804f9734c8\GuzzleHttp\Promise;
8
  * Thenning off of this promise will invoke the onRejected callback
9
  * immediately and ignore other callbacks.
10
  */
11
- class RejectedPromise implements \_PhpScoper5b6804f9734c8\GuzzleHttp\Promise\PromiseInterface
12
  {
13
  private $reason;
 
14
  public function __construct($reason)
15
  {
16
- if (\method_exists($reason, 'then')) {
17
- throw new \InvalidArgumentException('You cannot create a RejectedPromise with a promise.');
 
18
  }
 
19
  $this->reason = $reason;
20
  }
21
- public function then(callable $onFulfilled = null, callable $onRejected = null)
22
- {
 
 
 
23
  // If there's no onRejected callback then just return self.
24
  if (!$onRejected) {
25
  return $this;
26
  }
 
27
  $queue = queue();
28
  $reason = $this->reason;
29
- $p = new \_PhpScoper5b6804f9734c8\GuzzleHttp\Promise\Promise([$queue, 'run']);
30
- $queue->add(static function () use($p, $reason, $onRejected) {
31
  if ($p->getState() === self::PENDING) {
32
  try {
33
  // Return a resolved promise if onRejected does not throw.
@@ -41,32 +47,39 @@ class RejectedPromise implements \_PhpScoper5b6804f9734c8\GuzzleHttp\Promise\Pro
41
  }
42
  }
43
  });
 
44
  return $p;
45
  }
 
46
  public function otherwise(callable $onRejected)
47
  {
48
  return $this->then(null, $onRejected);
49
  }
50
- public function wait($unwrap = \true, $defaultDelivery = null)
 
51
  {
52
  if ($unwrap) {
53
  throw exception_for($this->reason);
54
  }
55
  }
 
56
  public function getState()
57
  {
58
  return self::REJECTED;
59
  }
 
60
  public function resolve($value)
61
  {
62
  throw new \LogicException("Cannot resolve a rejected promise");
63
  }
 
64
  public function reject($reason)
65
  {
66
  if ($reason !== $this->reason) {
67
  throw new \LogicException("Cannot reject a rejected promise");
68
  }
69
  }
 
70
  public function cancel()
71
  {
72
  // pass
1
  <?php
2
+ namespace GuzzleHttp\Promise;
 
3
 
4
  /**
5
  * A promise that has been rejected.
7
  * Thenning off of this promise will invoke the onRejected callback
8
  * immediately and ignore other callbacks.
9
  */
10
+ class RejectedPromise implements PromiseInterface
11
  {
12
  private $reason;
13
+
14
  public function __construct($reason)
15
  {
16
+ if (method_exists($reason, 'then')) {
17
+ throw new \InvalidArgumentException(
18
+ 'You cannot create a RejectedPromise with a promise.');
19
  }
20
+
21
  $this->reason = $reason;
22
  }
23
+
24
+ public function then(
25
+ callable $onFulfilled = null,
26
+ callable $onRejected = null
27
+ ) {
28
  // If there's no onRejected callback then just return self.
29
  if (!$onRejected) {
30
  return $this;
31
  }
32
+
33
  $queue = queue();
34
  $reason = $this->reason;
35
+ $p = new Promise([$queue, 'run']);
36
+ $queue->add(static function () use ($p, $reason, $onRejected) {
37
  if ($p->getState() === self::PENDING) {
38
  try {
39
  // Return a resolved promise if onRejected does not throw.
47
  }
48
  }
49
  });
50
+
51
  return $p;
52
  }
53
+
54
  public function otherwise(callable $onRejected)
55
  {
56
  return $this->then(null, $onRejected);
57
  }
58
+
59
+ public function wait($unwrap = true, $defaultDelivery = null)
60
  {
61
  if ($unwrap) {
62
  throw exception_for($this->reason);
63
  }
64
  }
65
+
66
  public function getState()
67
  {
68
  return self::REJECTED;
69
  }
70
+
71
  public function resolve($value)
72
  {
73
  throw new \LogicException("Cannot resolve a rejected promise");
74
  }
75
+
76
  public function reject($reason)
77
  {
78
  if ($reason !== $this->reason) {
79
  throw new \LogicException("Cannot reject a rejected promise");
80
  }
81
  }
82
+
83
  public function cancel()
84
  {
85
  // pass
includes/mollie-api-php/vendor/guzzlehttp/promises/src/RejectionException.php CHANGED
@@ -1,6 +1,5 @@
1
  <?php
2
-
3
- namespace _PhpScoper5b6804f9734c8\GuzzleHttp\Promise;
4
 
5
  /**
6
  * A special exception that is thrown when waiting on a rejected promise.
@@ -11,6 +10,7 @@ class RejectionException extends \RuntimeException
11
  {
12
  /** @var mixed Rejection reason. */
13
  private $reason;
 
14
  /**
15
  * @param mixed $reason Rejection reason.
16
  * @param string $description Optional description
@@ -18,16 +18,23 @@ class RejectionException extends \RuntimeException
18
  public function __construct($reason, $description = null)
19
  {
20
  $this->reason = $reason;
 
21
  $message = 'The promise was rejected';
 
22
  if ($description) {
23
  $message .= ' with reason: ' . $description;
24
- } elseif (\is_string($reason) || \is_object($reason) && \method_exists($reason, '__toString')) {
 
 
25
  $message .= ' with reason: ' . $this->reason;
26
  } elseif ($reason instanceof \JsonSerializable) {
27
- $message .= ' with reason: ' . \json_encode($this->reason, \JSON_PRETTY_PRINT);
 
28
  }
 
29
  parent::__construct($message);
30
  }
 
31
  /**
32
  * Returns the rejection reason.
33
  *
1
  <?php
2
+ namespace GuzzleHttp\Promise;
 
3
 
4
  /**
5
  * A special exception that is thrown when waiting on a rejected promise.
10
  {
11
  /** @var mixed Rejection reason. */
12
  private $reason;
13
+
14
  /**
15
  * @param mixed $reason Rejection reason.
16
  * @param string $description Optional description
18
  public function __construct($reason, $description = null)
19
  {
20
  $this->reason = $reason;
21
+
22
  $message = 'The promise was rejected';
23
+
24
  if ($description) {
25
  $message .= ' with reason: ' . $description;
26
+ } elseif (is_string($reason)
27
+ || (is_object($reason) && method_exists($reason, '__toString'))
28
+ ) {
29
  $message .= ' with reason: ' . $this->reason;
30
  } elseif ($reason instanceof \JsonSerializable) {
31
+ $message .= ' with reason: '
32
+ . json_encode($this->reason, JSON_PRETTY_PRINT);
33
  }
34
+
35
  parent::__construct($message);
36
  }
37
+
38
  /**
39
  * Returns the rejection reason.
40
  *
includes/mollie-api-php/vendor/guzzlehttp/promises/src/TaskQueue.php CHANGED
@@ -1,6 +1,5 @@
1
  <?php
2
-
3
- namespace _PhpScoper5b6804f9734c8\GuzzleHttp\Promise;
4
 
5
  /**
6
  * A task queue that executes tasks in a FIFO order.
@@ -11,39 +10,44 @@ namespace _PhpScoper5b6804f9734c8\GuzzleHttp\Promise;
11
  *
12
  * GuzzleHttp\Promise\queue()->run();
13
  */
14
- class TaskQueue implements \_PhpScoper5b6804f9734c8\GuzzleHttp\Promise\TaskQueueInterface
15
  {
16
- private $enableShutdown = \true;
17
  private $queue = [];
18
- public function __construct($withShutdown = \true)
 
19
  {
20
  if ($withShutdown) {
21
- \register_shutdown_function(function () {
22
  if ($this->enableShutdown) {
23
  // Only run the tasks if an E_ERROR didn't occur.
24
- $err = \error_get_last();
25
- if (!$err || $err['type'] ^ \E_ERROR) {
26
  $this->run();
27
  }
28
  }
29
  });
30
  }
31
  }
 
32
  public function isEmpty()
33
  {
34
  return !$this->queue;
35
  }
 
36
  public function add(callable $task)
37
  {
38
  $this->queue[] = $task;
39
  }
 
40
  public function run()
41
  {
42
  /** @var callable $task */
43
- while ($task = \array_shift($this->queue)) {
44
  $task();
45
  }
46
  }
 
47
  /**
48
  * The task queue will be run and exhausted by default when the process
49
  * exits IFF the exit is not the result of a PHP E_ERROR error.
@@ -57,6 +61,6 @@ class TaskQueue implements \_PhpScoper5b6804f9734c8\GuzzleHttp\Promise\TaskQueue
57
  */
58
  public function disableShutdown()
59
  {
60
- $this->enableShutdown = \false;
61
  }
62
  }
1
  <?php
2
+ namespace GuzzleHttp\Promise;
 
3
 
4
  /**
5
  * A task queue that executes tasks in a FIFO order.
10
  *
11
  * GuzzleHttp\Promise\queue()->run();
12
  */
13
+ class TaskQueue implements TaskQueueInterface
14
  {
15
+ private $enableShutdown = true;
16
  private $queue = [];
17
+
18
+ public function __construct($withShutdown = true)
19
  {
20
  if ($withShutdown) {
21
+ register_shutdown_function(function () {
22
  if ($this->enableShutdown) {
23
  // Only run the tasks if an E_ERROR didn't occur.
24
+ $err = error_get_last();
25
+ if (!$err || ($err['type'] ^ E_ERROR)) {
26
  $this->run();
27
  }
28
  }
29
  });
30
  }
31
  }
32
+
33
  public function isEmpty()
34
  {
35
  return !$this->queue;
36
  }
37
+
38
  public function add(callable $task)
39
  {
40
  $this->queue[] = $task;
41
  }
42
+
43
  public function run()
44
  {
45
  /** @var callable $task */
46
+ while ($task = array_shift($this->queue)) {
47
  $task();
48
  }
49
  }
50
+
51
  /**
52
  * The task queue will be run and exhausted by default when the process
53
  * exits IFF the exit is not the result of a PHP E_ERROR error.
61
  */
62
  public function disableShutdown()
63
  {
64
+ $this->enableShutdown = false;
65
  }
66
  }
includes/mollie-api-php/vendor/guzzlehttp/promises/src/TaskQueueInterface.php CHANGED
@@ -1,6 +1,5 @@
1
  <?php
2
-
3
- namespace _PhpScoper5b6804f9734c8\GuzzleHttp\Promise;
4
 
5
  interface TaskQueueInterface
6
  {
@@ -10,6 +9,7 @@ interface TaskQueueInterface
10
  * @return bool
11
  */
12
  public function isEmpty();
 
13
  /**
14
  * Adds a task to the queue that will be executed the next time run is
15
  * called.
@@ -17,6 +17,7 @@ interface TaskQueueInterface
17
  * @param callable $task
18
  */
19
  public function add(callable $task);
 
20
  /**
21
  * Execute all of the pending task in the queue.
22
  */
1
  <?php
2
+ namespace GuzzleHttp\Promise;
 
3
 
4
  interface TaskQueueInterface
5
  {
9
  * @return bool
10
  */
11
  public function isEmpty();
12
+
13
  /**
14
  * Adds a task to the queue that will be executed the next time run is
15
  * called.
17
  * @param callable $task
18
  */
19
  public function add(callable $task);
20
+
21
  /**
22
  * Execute all of the pending task in the queue.
23
  */
includes/mollie-api-php/vendor/guzzlehttp/promises/src/functions.php CHANGED
@@ -1,6 +1,5 @@
1
  <?php
2
-
3
- namespace _PhpScoper5b6804f9734c8\GuzzleHttp\Promise;
4
 
5
  /**
6
  * Get the global task queue used for promise resolution.
@@ -19,16 +18,19 @@ namespace _PhpScoper5b6804f9734c8\GuzzleHttp\Promise;
19
  *
20
  * @return TaskQueueInterface
21
  */
22
- function queue(\_PhpScoper5b6804f9734c8\GuzzleHttp\Promise\TaskQueueInterface $assign = null)
23
  {
24
  static $queue;
 
25
  if ($assign) {
26
  $queue = $assign;
27
  } elseif (!$queue) {
28
- $queue = new \_PhpScoper5b6804f9734c8\GuzzleHttp\Promise\TaskQueue();
29
  }
 
30
  return $queue;
31
  }
 
32
  /**
33
  * Adds a function to run in the task queue when it is next `run()` and returns
34
  * a promise that is fulfilled or rejected with the result.
@@ -40,8 +42,8 @@ function queue(\_PhpScoper5b6804f9734c8\GuzzleHttp\Promise\TaskQueueInterface $a
40
  function task(callable $task)
41
  {
42
  $queue = queue();
43
- $promise = new \_PhpScoper5b6804f9734c8\GuzzleHttp\Promise\Promise([$queue, 'run']);
44
- $queue->add(function () use($task, $promise) {
45
  try {
46
  $promise->resolve($task());
47
  } catch (\Throwable $e) {
@@ -50,8 +52,10 @@ function task(callable $task)
50
  $promise->reject($e);
51
  }
52
  });
 
53
  return $promise;
54
  }
 
55
  /**
56
  * Creates a promise for a value if the value is not a promise.
57
  *
@@ -61,19 +65,22 @@ function task(callable $task)
61
  */
62
  function promise_for($value)
63
  {
64
- if ($value instanceof \_PhpScoper5b6804f9734c8\GuzzleHttp\Promise\PromiseInterface) {
65
  return $value;
66
  }
 
67
  // Return a Guzzle promise that shadows the given promise.
68
- if (\method_exists($value, 'then')) {
69
- $wfn = \method_exists($value, 'wait') ? [$value, 'wait'] : null;
70
- $cfn = \method_exists($value, 'cancel') ? [$value, 'cancel'] : null;
71
- $promise = new \_PhpScoper5b6804f9734c8\GuzzleHttp\Promise\Promise($wfn, $cfn);
72
  $value->then([$promise, 'resolve'], [$promise, 'reject']);
73
  return $promise;
74
  }
75
- return new \_PhpScoper5b6804f9734c8\GuzzleHttp\Promise\FulfilledPromise($value);
 
76
  }
 
77
  /**
78
  * Creates a rejected promise for a reason if the reason is not a promise. If
79
  * the provided reason is a promise, then it is returned as-is.
@@ -84,11 +91,13 @@ function promise_for($value)
84
  */
85
  function rejection_for($reason)
86
  {
87
- if ($reason instanceof \_PhpScoper5b6804f9734c8\GuzzleHttp\Promise\PromiseInterface) {
88
  return $reason;
89
  }
90
- return new \_PhpScoper5b6804f9734c8\GuzzleHttp\Promise\RejectedPromise($reason);
 
91
  }
 
92
  /**
93
  * Create an exception for a rejected promise value.
94
  *
@@ -98,8 +107,11 @@ function rejection_for($reason)
98
  */
99
  function exception_for($reason)
100
  {
101
- return $reason instanceof \Exception || $reason instanceof \Throwable ? $reason : new \_PhpScoper5b6804f9734c8\GuzzleHttp\Promise\RejectionException($reason);
 
 
102
  }
 
103
  /**
104
  * Returns an iterator for the given value.
105
  *
@@ -111,12 +123,13 @@ function iter_for($value)
111
  {
112
  if ($value instanceof \Iterator) {
113
  return $value;
114
- } elseif (\is_array($value)) {
115
  return new \ArrayIterator($value);
116
  } else {
117
  return new \ArrayIterator([$value]);
118
  }
119
  }
 
120
  /**
121
  * Synchronously waits on a promise to resolve and returns an inspection state
122
  * array.
@@ -131,18 +144,22 @@ function iter_for($value)
131
  *
132
  * @return array
133
  */
134
- function inspect(\_PhpScoper5b6804f9734c8\GuzzleHttp\Promise\PromiseInterface $promise)
135
  {
136
  try {
137
- return ['state' => \_PhpScoper5b6804f9734c8\GuzzleHttp\Promise\PromiseInterface::FULFILLED, 'value' => $promise->wait()];
138
- } catch (\_PhpScoper5b6804f9734c8\GuzzleHttp\Promise\RejectionException $e) {
139
- return ['state' => \_PhpScoper5b6804f9734c8\GuzzleHttp\Promise\PromiseInterface::REJECTED, 'reason' => $e->getReason()];
 
 
 
140
  } catch (\Throwable $e) {
141
- return ['state' => \_PhpScoper5b6804f9734c8\GuzzleHttp\Promise\PromiseInterface::REJECTED, 'reason' => $e];
142
  } catch (\Exception $e) {
143
- return ['state' => \_PhpScoper5b6804f9734c8\GuzzleHttp\Promise\PromiseInterface::REJECTED, 'reason' => $e];
144
  }
145
  }
 
146
  /**
147
  * Waits on all of the provided promises, but does not unwrap rejected promises
148
  * as thrown exception.
@@ -160,8 +177,10 @@ function inspect_all($promises)
160
  foreach ($promises as $key => $promise) {
161
  $results[$key] = inspect($promise);
162
  }
 
163
  return $results;
164
  }
 
165
  /**
166
  * Waits on all of the provided promises and returns the fulfilled values.
167
  *
@@ -181,8 +200,10 @@ function unwrap($promises)
181
  foreach ($promises as $key => $promise) {
182
  $results[$key] = $promise->wait();
183
  }
 
184
  return $results;
185
  }
 
186
  /**
187
  * Given an array of promises, return a promise that is fulfilled when all the
188
  * items in the array are fulfilled.
@@ -198,15 +219,20 @@ function unwrap($promises)
198
  function all($promises)
199
  {
200
  $results = [];
201
- return \each($promises, function ($value, $idx) use(&$results) {
202
- $results[$idx] = $value;
203
- }, function ($reason, $idx, \_PhpScoper5b6804f9734c8\GuzzleHttp\Promise\Promise $aggregate) {
204
- $aggregate->reject($reason);
205
- })->then(function () use(&$results) {
206
- \ksort($results);
 
 
 
 
207
  return $results;
208
  });
209
  }
 
210
  /**
211
  * Initiate a competitive race between multiple promises or values (values will
212
  * become immediately fulfilled promises).
@@ -227,24 +253,35 @@ function some($count, $promises)
227
  {
228
  $results = [];
229
  $rejections = [];
230
- return \each($promises, function ($value, $idx, \_PhpScoper5b6804f9734c8\GuzzleHttp\Promise\PromiseInterface $p) use(&$results, $count) {
231
- if ($p->getState() !== \_PhpScoper5b6804f9734c8\GuzzleHttp\Promise\PromiseInterface::PENDING) {
232
- return;
233
- }
234
- $results[$idx] = $value;
235
- if (\count($results) >= $count) {
236
- $p->resolve(null);
 
 
 
 
 
 
 
237
  }
238
- }, function ($reason) use(&$rejections) {
239
- $rejections[] = $reason;
240
- })->then(function () use(&$results, &$rejections, $count) {
241
- if (\count($results) !== $count) {
242
- throw new \_PhpScoper5b6804f9734c8\GuzzleHttp\Promise\AggregateException('Not enough promises to fulfill count', $rejections);
 
 
 
 
 
243
  }
244
- \ksort($results);
245
- return \array_values($results);
246
- });
247
  }
 
248
  /**
249
  * Like some(), with 1 as count. However, if the promise fulfills, the
250
  * fulfillment value is not an array of 1 but the value directly.
@@ -255,10 +292,9 @@ function some($count, $promises)
255
  */
256
  function any($promises)
257
  {
258
- return some(1, $promises)->then(function ($values) {
259
- return $values[0];
260
- });
261
  }
 
262
  /**
263
  * Returns a promise that is fulfilled when all of the provided promises have
264
  * been fulfilled or rejected.
@@ -273,15 +309,21 @@ function any($promises)
273
  function settle($promises)
274
  {
275
  $results = [];
276
- return \each($promises, function ($value, $idx) use(&$results) {
277
- $results[$idx] = ['state' => \_PhpScoper5b6804f9734c8\GuzzleHttp\Promise\PromiseInterface::FULFILLED, 'value' => $value];
278
- }, function ($reason, $idx) use(&$results) {
279
- $results[$idx] = ['state' => \_PhpScoper5b6804f9734c8\GuzzleHttp\Promise\PromiseInterface::REJECTED, 'reason' => $reason];
280
- })->then(function () use(&$results) {
281
- \ksort($results);
 
 
 
 
 
282
  return $results;
283
  });
284
  }
 
285
  /**
286
  * Given an iterator that yields promises or values, returns a promise that is
287
  * fulfilled with a null value when the iterator has been consumed or the
@@ -301,10 +343,17 @@ function settle($promises)
301
  *
302
  * @return PromiseInterface
303
  */
304
- function each($iterable, callable $onFulfilled = null, callable $onRejected = null)
305
- {
306
- return (new \_PhpScoper5b6804f9734c8\GuzzleHttp\Promise\EachPromise($iterable, ['fulfilled' => $onFulfilled, 'rejected' => $onRejected]))->promise();
 
 
 
 
 
 
307
  }
 
308
  /**
309
  * Like each, but only allows a certain number of outstanding promises at any
310
  * given time.
@@ -320,10 +369,19 @@ function each($iterable, callable $onFulfilled = null, callable $onRejected = nu
320
  *
321
  * @return PromiseInterface
322
  */
323
- function each_limit($iterable, $concurrency, callable $onFulfilled = null, callable $onRejected = null)
324
- {
325
- return (new \_PhpScoper5b6804f9734c8\GuzzleHttp\Promise\EachPromise($iterable, ['fulfilled' => $onFulfilled, 'rejected' => $onRejected, 'concurrency' => $concurrency]))->promise();
 
 
 
 
 
 
 
 
326
  }
 
327
  /**
328
  * Like each_limit, but ensures that no promise in the given $iterable argument
329
  * is rejected. If any promise is rejected, then the aggregate promise is
@@ -335,12 +393,21 @@ function each_limit($iterable, $concurrency, callable $onFulfilled = null, calla
335
  *
336
  * @return PromiseInterface
337
  */
338
- function each_limit_all($iterable, $concurrency, callable $onFulfilled = null)
339
- {
340
- return each_limit($iterable, $concurrency, $onFulfilled, function ($reason, $idx, \_PhpScoper5b6804f9734c8\GuzzleHttp\Promise\PromiseInterface $aggregate) {
341
- $aggregate->reject($reason);
342
- });
 
 
 
 
 
 
 
 
343
  }
 
344
  /**
345
  * Returns true if a promise is fulfilled.
346
  *
@@ -348,10 +415,11 @@ function each_limit_all($iterable, $concurrency, callable $onFulfilled = null)
348
  *
349
  * @return bool
350
  */
351
- function is_fulfilled(\_PhpScoper5b6804f9734c8\GuzzleHttp\Promise\PromiseInterface $promise)
352
  {
353
- return $promise->getState() === \_PhpScoper5b6804f9734c8\GuzzleHttp\Promise\PromiseInterface::FULFILLED;
354
  }
 
355
  /**
356
  * Returns true if a promise is rejected.
357
  *
@@ -359,10 +427,11 @@ function is_fulfilled(\_PhpScoper5b6804f9734c8\GuzzleHttp\Promise\PromiseInterfa
359
  *
360
  * @return bool
361
  */
362
- function is_rejected(\_PhpScoper5b6804f9734c8\GuzzleHttp\Promise\PromiseInterface $promise)
363
  {
364
- return $promise->getState() === \_PhpScoper5b6804f9734c8\GuzzleHttp\Promise\PromiseInterface::REJECTED;
365
  }
 
366
  /**
367
  * Returns true if a promise is fulfilled or rejected.
368
  *
@@ -370,10 +439,11 @@ function is_rejected(\_PhpScoper5b6804f9734c8\GuzzleHttp\Promise\PromiseInterfac
370
  *
371
  * @return bool
372
  */
373
- function is_settled(\_PhpScoper5b6804f9734c8\GuzzleHttp\Promise\PromiseInterface $promise)
374
  {
375
- return $promise->getState() !== \_PhpScoper5b6804f9734c8\GuzzleHttp\Promise\PromiseInterface::PENDING;
376
  }
 
377
  /**
378
  * @see Coroutine
379
  *
@@ -383,5 +453,5 @@ function is_settled(\_PhpScoper5b6804f9734c8\GuzzleHttp\Promise\PromiseInterface
383
  */
384
  function coroutine(callable $generatorFn)
385
  {
386
- return new \_PhpScoper5b6804f9734c8\GuzzleHttp\Promise\Coroutine($generatorFn);
387
  }
1
  <?php
2
+ namespace GuzzleHttp\Promise;
 
3
 
4
  /**
5
  * Get the global task queue used for promise resolution.
18
  *
19
  * @return TaskQueueInterface
20
  */
21
+ function queue(TaskQueueInterface $assign = null)
22
  {
23
  static $queue;
24
+
25
  if ($assign) {
26
  $queue = $assign;
27
  } elseif (!$queue) {
28
+ $queue = new TaskQueue();
29
  }
30
+
31
  return $queue;
32
  }
33
+
34
  /**
35
  * Adds a function to run in the task queue when it is next `run()` and returns
36
  * a promise that is fulfilled or rejected with the result.
42
  function task(callable $task)
43
  {
44
  $queue = queue();
45
+ $promise = new Promise([$queue, 'run']);
46
+ $queue->add(function () use ($task, $promise) {
47
  try {
48
  $promise->resolve($task());
49
  } catch (\Throwable $e) {
52
  $promise->reject($e);
53
  }
54
  });
55
+
56
  return $promise;
57
  }
58
+
59
  /**
60
  * Creates a promise for a value if the value is not a promise.
61
  *
65
  */
66
  function promise_for($value)
67
  {
68
+ if ($value instanceof PromiseInterface) {
69
  return $value;
70
  }
71
+
72
  // Return a Guzzle promise that shadows the given promise.
73
+ if (method_exists($value, 'then')) {
74
+ $wfn = method_exists($value, 'wait') ? [$value, 'wait'] : null;
75
+ $cfn = method_exists($value, 'cancel') ? [$value, 'cancel'] : null;
76
+ $promise = new Promise($wfn, $cfn);
77
  $value->then([$promise, 'resolve'], [$promise, 'reject']);
78
  return $promise;
79
  }
80
+
81
+ return new FulfilledPromise($value);
82
  }
83
+
84
  /**
85
  * Creates a rejected promise for a reason if the reason is not a promise. If
86
  * the provided reason is a promise, then it is returned as-is.
91
  */
92
  function rejection_for($reason)
93
  {
94
+ if ($reason instanceof PromiseInterface) {
95
  return $reason;
96
  }
97
+
98
+ return new RejectedPromise($reason);
99
  }
100
+
101
  /**
102
  * Create an exception for a rejected promise value.
103
  *
107
  */
108
  function exception_for($reason)
109
  {
110
+ return $reason instanceof \Exception || $reason instanceof \Throwable
111
+ ? $reason
112
+ : new RejectionException($reason);
113
  }
114
+
115
  /**
116
  * Returns an iterator for the given value.
117
  *
123
  {
124
  if ($value instanceof \Iterator) {
125
  return $value;
126
+ } elseif (is_array($value)) {
127
  return new \ArrayIterator($value);
128
  } else {
129
  return new \ArrayIterator([$value]);
130
  }
131
  }
132
+
133
  /**
134
  * Synchronously waits on a promise to resolve and returns an inspection state
135
  * array.
144
  *
145
  * @return array
146
  */
147
+ function inspect(PromiseInterface $promise)
148
  {
149
  try {
150
+ return [
151
+ 'state' => PromiseInterface::FULFILLED,
152
+ 'value' => $promise->wait()
153
+ ];
154
+ } catch (RejectionException $e) {
155
+ return ['state' => PromiseInterface::REJECTED, 'reason' => $e->getReason()];
156
  } catch (\Throwable $e) {
157
+ return ['state' => PromiseInterface::REJECTED, 'reason' => $e];
158
  } catch (\Exception $e) {
159
+ return ['state' => PromiseInterface::REJECTED, 'reason' => $e];
160
  }
161
  }
162
+
163
  /**
164
  * Waits on all of the provided promises, but does not unwrap rejected promises
165
  * as thrown exception.
177
  foreach ($promises as $key => $promise) {
178
  $results[$key] = inspect($promise);
179
  }
180
+
181
  return $results;
182
  }
183
+
184
  /**
185
  * Waits on all of the provided promises and returns the fulfilled values.
186
  *
200
  foreach ($promises as $key => $promise) {
201
  $results[$key] = $promise->wait();
202
  }
203
+
204
  return $results;
205
  }
206
+
207
  /**
208
  * Given an array of promises, return a promise that is fulfilled when all the
209
  * items in the array are fulfilled.
219
  function all($promises)
220
  {
221
  $results = [];
222
+ return each(
223
+ $promises,
224
+ function ($value, $idx) use (&$results) {
225
+ $results[$idx] = $value;
226
+ },
227
+ function ($reason, $idx, Promise $aggregate) {
228
+ $aggregate->reject($reason);
229
+ }
230
+ )->then(function () use (&$results) {
231
+ ksort($results);
232
  return $results;
233
  });
234
  }
235
+
236
  /**
237
  * Initiate a competitive race between multiple promises or values (values will
238
  * become immediately fulfilled promises).
253
  {
254
  $results = [];
255
  $rejections = [];
256
+
257
+ return each(
258
+ $promises,
259
+ function ($value, $idx, PromiseInterface $p) use (&$results, $count) {
260
+ if ($p->getState() !== PromiseInterface::PENDING) {
261
+ return;
262
+ }
263
+ $results[$idx] = $value;
264
+ if (count($results) >= $count) {
265
+ $p->resolve(null);
266
+ }
267
+ },
268
+ function ($reason) use (&$rejections) {
269
+ $rejections[] = $reason;
270
  }
271
+ )->then(
272
+ function () use (&$results, &$rejections, $count) {
273
+ if (count($results) !== $count) {
274
+ throw new AggregateException(
275
+ 'Not enough promises to fulfill count',
276
+ $rejections
277
+ );
278
+ }
279
+ ksort($results);
280
+ return array_values($results);
281
  }
282
+ );
 
 
283
  }
284
+
285
  /**
286
  * Like some(), with 1 as count. However, if the promise fulfills, the
287
  * fulfillment value is not an array of 1 but the value directly.
292
  */
293
  function any($promises)
294
  {
295
+ return some(1, $promises)->then(function ($values) { return $values[0]; });
 
 
296
  }
297
+
298
  /**
299
  * Returns a promise that is fulfilled when all of the provided promises have
300
  * been fulfilled or rejected.
309
  function settle($promises)
310
  {
311
  $results = [];
312
+
313
+ return each(
314
+ $promises,
315
+ function ($value, $idx) use (&$results) {
316
+ $results[$idx] = ['state' => PromiseInterface::FULFILLED, 'value' => $value];
317
+ },
318
+ function ($reason, $idx) use (&$results) {
319
+ $results[$idx] = ['state' => PromiseInterface::REJECTED, 'reason' => $reason];
320
+ }
321
+ )->then(function () use (&$results) {
322
+ ksort($results);
323
  return $results;
324
  });
325
  }
326
+
327
  /**
328
  * Given an iterator that yields promises or values, returns a promise that is
329
  * fulfilled with a null value when the iterator has been consumed or the
343
  *
344
  * @return PromiseInterface
345
  */
346
+ function each(
347
+ $iterable,
348
+ callable $onFulfilled = null,
349
+ callable $onRejected = null
350
+ ) {
351
+ return (new EachPromise($iterable, [
352
+ 'fulfilled' => $onFulfilled,
353
+ 'rejected' => $onRejected
354
+ ]))->promise();
355
  }
356
+
357
  /**
358
  * Like each, but only allows a certain number of outstanding promises at any
359
  * given time.
369
  *
370
  * @return PromiseInterface
371
  */
372
+ function each_limit(
373
+ $iterable,
374
+ $concurrency,
375
+ callable $onFulfilled = null,
376
+ callable $onRejected = null
377
+ ) {
378
+ return (new EachPromise($iterable, [
379
+ 'fulfilled' => $onFulfilled,
380
+ 'rejected' => $onRejected,
381
+ 'concurrency' => $concurrency
382
+ ]))->promise();
383
  }
384
+
385
  /**
386
  * Like each_limit, but ensures that no promise in the given $iterable argument
387
  * is rejected. If any promise is rejected, then the aggregate promise is
393
  *
394
  * @return PromiseInterface
395
  */
396
+ function each_limit_all(
397
+ $iterable,
398
+ $concurrency,
399
+ callable $onFulfilled = null
400
+ ) {
401
+ return each_limit(
402
+ $iterable,
403
+ $concurrency,
404
+ $onFulfilled,
405
+ function ($reason, $idx, PromiseInterface $aggregate) {
406
+ $aggregate->reject($reason);
407
+ }
408
+ );
409
  }
410
+
411
  /**
412
  * Returns true if a promise is fulfilled.
413
  *
415
  *
416
  * @return bool
417
  */
418
+ function is_fulfilled(PromiseInterface $promise)
419
  {
420
+ return $promise->getState() === PromiseInterface::FULFILLED;
421
  }
422
+
423
  /**
424
  * Returns true if a promise is rejected.
425
  *
427
  *
428
  * @return bool
429
  */
430
+ function is_rejected(PromiseInterface $promise)
431
  {
432
+ return $promise->getState() === PromiseInterface::REJECTED;
433
  }
434
+
435
  /**
436
  * Returns true if a promise is fulfilled or rejected.
437
  *
439
  *
440
  * @return bool
441
  */
442
+ function is_settled(PromiseInterface $promise)
443
  {
444
+ return $promise->getState() !== PromiseInterface::PENDING;
445
  }
446
+
447
  /**
448
  * @see Coroutine
449
  *
453
  */
454
  function coroutine(callable $generatorFn)
455
  {
456
+ return new Coroutine($generatorFn);
457
  }
includes/mollie-api-php/vendor/guzzlehttp/promises/src/functions_include.php CHANGED
@@ -1,8 +1,6 @@
1
  <?php
2
 
3
- namespace _PhpScoper5b6804f9734c8;
4
-
5
  // Don't redefine the functions if included multiple times.
6
- if (!\function_exists('_PhpScoper5b6804f9734c8\\GuzzleHttp\\Promise\\promise_for')) {
7
  require __DIR__ . '/functions.php';
8
  }
1
  <?php
2
 
 
 
3
  // Don't redefine the functions if included multiple times.
4
+ if (!function_exists('GuzzleHttp\Promise\promise_for')) {
5
  require __DIR__ . '/functions.php';
6
  }
includes/mollie-api-php/vendor/guzzlehttp/psr7/composer.json CHANGED
@@ -1,49 +1,39 @@
1
  {
2
- "name": "guzzlehttp\/psr7",
3
  "type": "library",
4
  "description": "PSR-7 message implementation that also provides common utility methods",
5
- "keywords": [
6
- "request",
7
- "response",
8
- "message",
9
- "stream",
10
- "http",
11
- "uri",
12
- "url"
13
- ],
14
  "license": "MIT",
15
  "authors": [
16
  {
17
  "name": "Michael Dowling",
18
  "email": "mtdowling@gmail.com",
19
- "homepage": "https:\/\/github.com\/mtdowling"
20
  },
21
  {
22
  "name": "Tobias Schultze",
23
- "homepage": "https:\/\/github.com\/Tobion"
24
  }
25
  ],
26
  "require": {
27
  "php": ">=5.4.0",
28
- "psr\/http-message": "~1.0"
29
  },
30
  "require-dev": {
31
- "phpunit\/phpunit": "~4.0"
32
  },
33
  "provide": {
34
- "psr\/http-message-implementation": "1.0"
35
  },
36
  "autoload": {
37
  "psr-4": {
38
- "_PhpScoper5b6804f9734c8\\GuzzleHttp\\Psr7\\": "src\/"
39
  },
40
- "files": [
41
- "src\/functions_include.php"
42
- ]
43
  },
44
  "extra": {
45
  "branch-alias": {
46
  "dev-master": "1.4-dev"
47
  }
48
  }
49
- }
1
  {
2
+ "name": "guzzlehttp/psr7",
3
  "type": "library",
4
  "description": "PSR-7 message implementation that also provides common utility methods",
5
+ "keywords": ["request", "response", "message", "stream", "http", "uri", "url"],
 
 
 
 
 
 
 
 
6
  "license": "MIT",
7
  "authors": [
8
  {
9
  "name": "Michael Dowling",
10
  "email": "mtdowling@gmail.com",
11
+ "homepage": "https://github.com/mtdowling"
12
  },
13
  {
14
  "name": "Tobias Schultze",
15
+ "homepage": "https://github.com/Tobion"
16
  }
17
  ],
18
  "require": {
19
  "php": ">=5.4.0",
20
+ "psr/http-message": "~1.0"
21
  },
22
  "require-dev": {
23
+ "phpunit/phpunit": "~4.0"
24
  },
25
  "provide": {
26
+ "psr/http-message-implementation": "1.0"
27
  },
28
  "autoload": {
29
  "psr-4": {
30
+ "GuzzleHttp\\Psr7\\": "src/"
31
  },
32
+ "files": ["src/functions_include.php"]
 
 
33
  },
34
  "extra": {
35
  "branch-alias": {
36
  "dev-master": "1.4-dev"
37
  }
38
  }
39
+ }
includes/mollie-api-php/vendor/guzzlehttp/psr7/src/AppendStream.php CHANGED
@@ -1,21 +1,23 @@
1
  <?php
 
2
 
3
- namespace _PhpScoper5b6804f9734c8\GuzzleHttp\Psr7;
4
 
5
- use _PhpScoper5b6804f9734c8\Psr\Http\Message\StreamInterface;
6
  /**
7
  * Reads from multiple streams, one after the other.
8
  *
9
  * This is a read-only stream decorator.
10
  */
11
- class AppendStream implements \_PhpScoper5b6804f9734c8\Psr\Http\Message\StreamInterface
12
  {
13
  /** @var StreamInterface[] Streams being decorated */
14
  private $streams = [];
15
- private $seekable = \true;
 
16
  private $current = 0;
17
  private $pos = 0;
18
- private $detached = \false;
 
19
  /**
20
  * @param StreamInterface[] $streams Streams to decorate. Each stream must
21
  * be readable.
@@ -26,6 +28,7 @@ class AppendStream implements \_PhpScoper5b6804f9734c8\Psr\Http\Message\StreamIn
26
  $this->addStream($stream);
27
  }
28
  }
 
29
  public function __toString()
30
  {
31
  try {
@@ -35,6 +38,7 @@ class AppendStream implements \_PhpScoper5b6804f9734c8\Psr\Http\Message\StreamIn
35
  return '';
36
  }
37
  }
 
38
  /**
39
  * Add a stream to the AppendStream
40
  *
@@ -42,21 +46,25 @@ class AppendStream implements \_PhpScoper5b6804f9734c8\Psr\Http\Message\StreamIn
42
  *
43
  * @throws \InvalidArgumentException if the stream is not readable
44
  */
45
- public function addStream(\_PhpScoper5b6804f9734c8\Psr\Http\Message\StreamInterface $stream)
46
  {
47
  if (!$stream->isReadable()) {
48
  throw new \InvalidArgumentException('Each stream must be readable');
49
  }
 
50
  // The stream is only seekable if all streams are seekable
51
  if (!$stream->isSeekable()) {
52
- $this->seekable = \false;
53
  }
 
54
  $this->streams[] = $stream;
55
  }
 
56
  public function getContents()
57
  {
58
  return copy_to_string($this);
59
  }
 
60
  /**
61
  * Closes each attached stream.
62
  *
@@ -65,11 +73,14 @@ class AppendStream implements \_PhpScoper5b6804f9734c8\Psr\Http\Message\StreamIn
65
  public function close()
66
  {
67
  $this->pos = $this->current = 0;
 
68
  foreach ($this->streams as $stream) {
69
  $stream->close();
70
  }
 
71
  $this->streams = [];
72
  }
 
73
  /**
74
  * Detaches each attached stream
75
  *
@@ -78,12 +89,14 @@ class AppendStream implements \_PhpScoper5b6804f9734c8\Psr\Http\Message\StreamIn
78
  public function detach()
79
  {
80
  $this->close();
81
- $this->detached = \true;
82
  }
 
83
  public function tell()
84
  {
85
  return $this->pos;
86
  }
 
87
  /**
88
  * Tries to calculate the size by adding the size of each stream.
89
  *
@@ -95,6 +108,7 @@ class AppendStream implements \_PhpScoper5b6804f9734c8\Psr\Http\Message\StreamIn
95
  public function getSize()
96
  {
97
  $size = 0;
 
98
  foreach ($this->streams as $stream) {
99
  $s = $stream->getSize();
100
  if ($s === null) {
@@ -102,45 +116,56 @@ class AppendStream implements \_PhpScoper5b6804f9734c8\Psr\Http\Message\StreamIn
102
  }
103
  $size += $s;
104
  }
 
105
  return $size;
106
  }
 
107
  public function eof()
108
  {
109
- return !$this->streams || $this->current >= \count($this->streams) - 1 && $this->streams[$this->current]->eof();
 
 
110
  }
 
111
  public function rewind()
112
  {
113
  $this->seek(0);
114
  }
 
115
  /**
116
  * Attempts to seek to the given position. Only supports SEEK_SET.
117
  *
118
  * {@inheritdoc}
119
  */
120
- public function seek($offset, $whence = \SEEK_SET)
121
  {
122
  if (!$this->seekable) {
123
  throw new \RuntimeException('This AppendStream is not seekable');
124
- } elseif ($whence !== \SEEK_SET) {
125
  throw new \RuntimeException('The AppendStream can only seek with SEEK_SET');
126
  }
 
127
  $this->pos = $this->current = 0;
 
128
  // Rewind each stream
129
  foreach ($this->streams as $i => $stream) {
130
  try {
131
  $stream->rewind();
132
  } catch (\Exception $e) {
133
- throw new \RuntimeException('Unable to seek stream ' . $i . ' of the AppendStream', 0, $e);
 
134
  }
135
  }
 
136
  // Seek to the actual position by reading from each stream
137
  while ($this->pos < $offset && !$this->eof()) {
138
- $result = $this->read(\min(8096, $offset - $this->pos));
139
  if ($result === '') {
140
  break;
141
  }
142
  }
143
  }
 
144
  /**
145
  * Reads from all of the appended streams until the length is met or EOF.
146
  *
@@ -149,46 +174,58 @@ class AppendStream implements \_PhpScoper5b6804f9734c8\Psr\Http\Message\StreamIn
149
  public function read($length)
150
  {
151
  $buffer = '';
152
- $total = \count($this->streams) - 1;
153
  $remaining = $length;
154
- $progressToNext = \false;
 
155
  while ($remaining > 0) {
 
156
  // Progress to the next stream if needed.
157
  if ($progressToNext || $this->streams[$this->current]->eof()) {
158
- $progressToNext = \false;
159
  if ($this->current === $total) {
160
  break;
161
  }
162
  $this->current++;
163
  }
 
164
  $result = $this->streams[$this->current]->read($remaining);
 
165
  // Using a loose comparison here to match on '', false, and null
166
  if ($result == null) {
167
- $progressToNext = \true;
168
  continue;
169
  }
 
170
  $buffer .= $result;
171
- $remaining = $length - \strlen($buffer);
172
  }
173
- $this->pos += \strlen($buffer);
 
 
174
  return $buffer;
175
  }
 
176
  public function isReadable()
177
  {
178
- return \true;
179
  }
 
180
  public function isWritable()
181
  {
182
- return \false;
183
  }
 
184
  public function isSeekable()
185
  {
186
  return $this->seekable;
187
  }
 
188
  public function write($string)
189
  {
190
  throw new \RuntimeException('Cannot write to an AppendStream');
191
  }
 
192
  public function getMetadata($key = null)
193
  {
194
  return $key ? null : [];
1
  <?php
2
+ namespace GuzzleHttp\Psr7;
3
 
4
+ use Psr\Http\Message\StreamInterface;
5
 
 
6
  /**
7
  * Reads from multiple streams, one after the other.
8
  *
9
  * This is a read-only stream decorator.
10
  */
11
+ class AppendStream implements StreamInterface
12
  {
13
  /** @var StreamInterface[] Streams being decorated */
14
  private $streams = [];
15
+
16
+ private $seekable = true;
17
  private $current = 0;
18
  private $pos = 0;
19
+ private $detached = false;
20
+
21
  /**
22
  * @param StreamInterface[] $streams Streams to decorate. Each stream must
23
  * be readable.
28
  $this->addStream($stream);
29
  }
30
  }
31
+
32
  public function __toString()
33
  {
34
  try {
38
  return '';
39
  }
40
  }
41
+
42
  /**
43
  * Add a stream to the AppendStream
44
  *
46
  *
47
  * @throws \InvalidArgumentException if the stream is not readable
48
  */
49
+ public function addStream(StreamInterface $stream)
50
  {
51
  if (!$stream->isReadable()) {
52
  throw new \InvalidArgumentException('Each stream must be readable');
53
  }
54
+
55
  // The stream is only seekable if all streams are seekable
56
  if (!$stream->isSeekable()) {
57
+ $this->seekable = false;
58
  }
59
+
60
  $this->streams[] = $stream;
61
  }
62
+
63
  public function getContents()
64
  {
65
  return copy_to_string($this);
66
  }
67
+
68
  /**
69
  * Closes each attached stream.
70
  *
73
  public function close()
74
  {
75
  $this->pos = $this->current = 0;
76
+
77
  foreach ($this->streams as $stream) {
78
  $stream->close();
79
  }
80
+
81
  $this->streams = [];
82
  }
83
+
84
  /**
85
  * Detaches each attached stream
86
  *
89
  public function detach()
90
  {
91
  $this->close();
92
+ $this->detached = true;
93
  }
94
+
95
  public function tell()
96
  {
97
  return $this->pos;
98
  }
99
+
100
  /**
101
  * Tries to calculate the size by adding the size of each stream.
102
  *
108
  public function getSize()
109
  {
110
  $size = 0;
111
+
112
  foreach ($this->streams as $stream) {
113
  $s = $stream->getSize();
114
  if ($s === null) {
116
  }
117
  $size += $s;
118
  }
119
+
120
  return $size;
121
  }
122
+
123
  public function eof()
124
  {
125
+ return !$this->streams ||
126
+ ($this->current >= count($this->streams) - 1 &&
127
+ $this->streams[$this->current]->eof());
128
  }
129
+
130
  public function rewind()
131
  {
132
  $this->seek(0);
133
  }
134
+
135
  /**
136
  * Attempts to seek to the given position. Only supports SEEK_SET.
137
  *
138
  * {@inheritdoc}
139
  */
140
+ public function seek($offset, $whence = SEEK_SET)
141
  {
142
  if (!$this->seekable) {
143
  throw new \RuntimeException('This AppendStream is not seekable');
144
+ } elseif ($whence !== SEEK_SET) {
145
  throw new \RuntimeException('The AppendStream can only seek with SEEK_SET');
146
  }
147
+
148
  $this->pos = $this->current = 0;
149
+
150
  // Rewind each stream
151
  foreach ($this->streams as $i => $stream) {
152
  try {
153
  $stream->rewind();
154
  } catch (\Exception $e) {
155
+ throw new \RuntimeException('Unable to seek stream '
156
+ . $i . ' of the AppendStream', 0, $e);
157
  }
158
  }
159
+
160
  // Seek to the actual position by reading from each stream
161
  while ($this->pos < $offset && !$this->eof()) {
162
+ $result = $this->read(min(8096, $offset - $this->pos));
163
  if ($result === '') {
164
  break;
165
  }
166
  }
167
  }
168
+
169
  /**
170
  * Reads from all of the appended streams until the length is met or EOF.
171
  *
174
  public function read($length)
175
  {
176
  $buffer = '';
177
+ $total = count($this->streams) - 1;
178
  $remaining = $length;
179
+ $progressToNext = false;
180
+
181
  while ($remaining > 0) {
182
+
183
  // Progress to the next stream if needed.
184
  if ($progressToNext || $this->streams[$this->current]->eof()) {
185
+ $progressToNext = false;
186
  if ($this->current === $total) {
187
  break;
188
  }
189
  $this->current++;
190
  }
191
+
192
  $result = $this->streams[$this->current]->read($remaining);
193
+
194
  // Using a loose comparison here to match on '', false, and null
195
  if ($result == null) {
196
+ $progressToNext = true;
197
  continue;
198
  }
199
+
200
  $buffer .= $result;
201
+ $remaining = $length - strlen($buffer);
202
  }
203
+
204
+ $this->pos += strlen($buffer);
205
+
206
  return $buffer;
207
  }
208
+
209
  public function isReadable()
210
  {
211
+ return true;
212
  }
213
+
214
  public function isWritable()
215
  {
216
+ return false;
217
  }
218
+
219
  public function isSeekable()
220
  {
221
  return $this->seekable;
222
  }
223
+
224
  public function write($string)
225
  {
226
  throw new \RuntimeException('Cannot write to an AppendStream');
227
  }
228
+
229
  public function getMetadata($key = null)
230
  {
231
  return $key ? null : [];
includes/mollie-api-php/vendor/guzzlehttp/psr7/src/BufferStream.php CHANGED
@@ -1,8 +1,8 @@
1
  <?php
 
2
 
3
- namespace _PhpScoper5b6804f9734c8\GuzzleHttp\Psr7;
4
 
5
- use _PhpScoper5b6804f9734c8\Psr\Http\Message\StreamInterface;
6
  /**
7
  * Provides a buffer stream that can be written to to fill a buffer, and read
8
  * from to remove bytes from the buffer.
@@ -11,10 +11,11 @@ use _PhpScoper5b6804f9734c8\Psr\Http\Message\StreamInterface;
11
  * what the configured high water mark of the stream is, or the maximum
12
  * preferred size of the buffer.
13
  */
14
- class BufferStream implements \_PhpScoper5b6804f9734c8\Psr\Http\Message\StreamInterface
15
  {
16
  private $hwm;
17
  private $buffer = '';
 
18
  /**
19
  * @param int $hwm High water mark, representing the preferred maximum
20
  * buffer size. If the size of the buffer exceeds the high
@@ -26,90 +27,111 @@ class BufferStream implements \_PhpScoper5b6804f9734c8\Psr\Http\Message\StreamIn
26
  {
27
  $this->hwm = $hwm;
28
  }
 
29
  public function __toString()
30
  {
31
  return $this->getContents();
32
  }
 
33
  public function getContents()
34
  {
35
  $buffer = $this->buffer;
36
  $this->buffer = '';
 
37
  return $buffer;
38
  }
 
39
  public function close()
40
  {
41
  $this->buffer = '';
42
  }
 
43
  public function detach()
44
  {
45
  $this->close();
46
  }
 
47
  public function getSize()
48
  {
49
- return \strlen($this->buffer);
50
  }
 
51
  public function isReadable()
52
  {
53
- return \true;
54
  }
 
55
  public function isWritable()
56
  {
57
- return \true;
58
  }
 
59
  public function isSeekable()
60
  {
61
- return \false;
62
  }
 
63
  public function rewind()
64
  {
65
  $this->seek(0);
66
  }
67
- public function seek($offset, $whence = \SEEK_SET)
 
68
  {
69
  throw new \RuntimeException('Cannot seek a BufferStream');
70
  }
 
71
  public function eof()
72
  {
73
- return \strlen($this->buffer) === 0;
74
  }
 
75
  public function tell()
76
  {
77
  throw new \RuntimeException('Cannot determine the position of a BufferStream');
78
  }
 
79
  /**
80
  * Reads data from the buffer.
81
  */
82
  public function read($length)
83
  {
84
- $currentLength = \strlen($this->buffer);
 
85
  if ($length >= $currentLength) {
86
  // No need to slice the buffer because we don't have enough data.
87
  $result = $this->buffer;
88
  $this->buffer = '';
89
  } else {
90
  // Slice up the result to provide a subset of the buffer.
91
- $result = \substr($this->buffer, 0, $length);
92
- $this->buffer = \substr($this->buffer, $length);
93
  }
 
94
  return $result;
95
  }
 
96
  /**
97
  * Writes data to the buffer.
98
  */
99
  public function write($string)
100
  {
101
  $this->buffer .= $string;
 
102
  // TODO: What should happen here?
103
- if (\strlen($this->buffer) >= $this->hwm) {
104
- return \false;
105
  }
106
- return \strlen($string);
 
107
  }
 
108
  public function getMetadata($key = null)
109
  {
110
  if ($key == 'hwm') {
111
  return $this->hwm;
112
  }
 
113
  return $key ? null : [];
114
  }
115
  }
1
  <?php
2
+ namespace GuzzleHttp\Psr7;
3
 
4
+ use Psr\Http\Message\StreamInterface;
5
 
 
6
  /**
7
  * Provides a buffer stream that can be written to to fill a buffer, and read
8
  * from to remove bytes from the buffer.
11
  * what the configured high water mark of the stream is, or the maximum
12
  * preferred size of the buffer.
13
  */
14
+ class BufferStream implements StreamInterface
15
  {
16
  private $hwm;
17
  private $buffer = '';
18
+
19
  /**
20
  * @param int $hwm High water mark, representing the preferred maximum
21
  * buffer size. If the size of the buffer exceeds the high
27
  {
28
  $this->hwm = $hwm;
29
  }
30
+
31
  public function __toString()
32
  {
33
  return $this->getContents();
34
  }
35
+
36
  public function getContents()
37
  {
38
  $buffer = $this->buffer;
39
  $this->buffer = '';
40
+
41
  return $buffer;
42
  }
43
+
44
  public function close()
45
  {
46
  $this->buffer = '';
47
  }
48
+
49
  public function detach()
50
  {
51
  $this->close();
52
  }
53
+
54
  public function getSize()
55
  {
56
+ return strlen($this->buffer);
57
  }
58
+
59
  public function isReadable()
60
  {
61
+ return true;
62
  }
63
+
64
  public function isWritable()
65
  {
66
+ return true;
67
  }
68
+
69
  public function isSeekable()
70
  {
71
+ return false;
72
  }
73
+
74
  public function rewind()
75
  {
76
  $this->seek(0);
77
  }
78
+
79
+ public function seek($offset, $whence = SEEK_SET)
80
  {
81
  throw new \RuntimeException('Cannot seek a BufferStream');
82
  }
83
+
84
  public function eof()
85
  {
86
+ return strlen($this->buffer) === 0;
87
  }
88
+
89
  public function tell()
90
  {
91
  throw new \RuntimeException('Cannot determine the position of a BufferStream');
92
  }
93
+
94
  /**
95
  * Reads data from the buffer.
96
  */
97
  public function read($length)
98
  {
99
+ $currentLength = strlen($this->buffer);
100
+
101
  if ($length >= $currentLength) {
102
  // No need to slice the buffer because we don't have enough data.
103
  $result = $this->buffer;
104
  $this->buffer = '';
105
  } else {
106
  // Slice up the result to provide a subset of the buffer.
107
+ $result = substr($this->buffer, 0, $length);
108
+ $this->buffer = substr($this->buffer, $length);
109
  }
110
+
111
  return $result;
112
  }
113
+
114
  /**
115
  * Writes data to the buffer.
116
  */
117
  public function write($string)
118
  {
119
  $this->buffer .= $string;
120
+
121
  // TODO: What should happen here?
122
+ if (strlen($this->buffer) >= $this->hwm) {
123
+ return false;
124
  }
125
+
126
+ return strlen($string);
127
  }
128
+
129
  public function getMetadata($key = null)
130
  {
131
  if ($key == 'hwm') {
132
  return $this->hwm;
133
  }
134
+
135
  return $key ? null : [];
136
  }
137
  }
includes/mollie-api-php/vendor/guzzlehttp/psr7/src/CachingStream.php CHANGED
@@ -1,45 +1,53 @@
1
  <?php
 
2
 
3
- namespace _PhpScoper5b6804f9734c8\GuzzleHttp\Psr7;
4
 
5
- use _PhpScoper5b6804f9734c8\Psr\Http\Message\StreamInterface;
6
  /**
7
  * Stream decorator that can cache previously read bytes from a sequentially
8
  * read stream.
9
  */
10
- class CachingStream implements \_PhpScoper5b6804f9734c8\Psr\Http\Message\StreamInterface
11
  {
12
  use StreamDecoratorTrait;
 
13
  /** @var StreamInterface Stream being wrapped */
14
  private $remoteStream;
 
15
  /** @var int Number of bytes to skip reading due to a write on the buffer */
16
  private $skipReadBytes = 0;
 
17
  /**
18
  * We will treat the buffer object as the body of the stream
19
  *
20
  * @param StreamInterface $stream Stream to cache
21
  * @param StreamInterface $target Optionally specify where data is cached
22
  */
23
- public function __construct(\_PhpScoper5b6804f9734c8\Psr\Http\Message\StreamInterface $stream, \_PhpScoper5b6804f9734c8\Psr\Http\Message\StreamInterface $target = null)
24
- {
 
 
25
  $this->remoteStream = $stream;
26
- $this->stream = $target ?: new \_PhpScoper5b6804f9734c8\GuzzleHttp\Psr7\Stream(\fopen('php://temp', 'r+'));
27
  }
 
28
  public function getSize()
29
  {
30
- return \max($this->stream->getSize(), $this->remoteStream->getSize());
31
  }
 
32
  public function rewind()
33
  {
34
  $this->seek(0);
35
  }
36
- public function seek($offset, $whence = \SEEK_SET)
 
37
  {
38
- if ($whence == \SEEK_SET) {
39
  $byte = $offset;
40
- } elseif ($whence == \SEEK_CUR) {
41
  $byte = $offset + $this->tell();
42
- } elseif ($whence == \SEEK_END) {
43
  $size = $this->remoteStream->getSize();
44
  if ($size === null) {
45
  $size = $this->cacheEntireStream();
@@ -48,7 +56,9 @@ class CachingStream implements \_PhpScoper5b6804f9734c8\Psr\Http\Message\StreamI
48
  } else {
49
  throw new \InvalidArgumentException('Invalid whence');
50
  }
 
51
  $diff = $byte - $this->stream->getSize();
 
52
  if ($diff > 0) {
53
  // Read the remoteStream until we have read in at least the amount
54
  // of bytes requested, or we reach the end of the file.
@@ -61,44 +71,55 @@ class CachingStream implements \_PhpScoper5b6804f9734c8\Psr\Http\Message\StreamI
61
  $this->stream->seek($byte);
62
  }
63
  }
 
64
  public function read($length)
65
  {
66
  // Perform a regular read on any previously read data from the buffer
67
  $data = $this->stream->read($length);
68
- $remaining = $length - \strlen($data);
 
69
  // More data was requested so read from the remote stream
70
  if ($remaining) {
71
  // If data was written to the buffer in a position that would have
72
  // been filled from the remote stream, then we must skip bytes on
73
  // the remote stream to emulate overwriting bytes from that
74
  // position. This mimics the behavior of other PHP stream wrappers.
75
- $remoteData = $this->remoteStream->read($remaining + $this->skipReadBytes);
 
 
 
76
  if ($this->skipReadBytes) {
77
- $len = \strlen($remoteData);
78
- $remoteData = \substr($remoteData, $this->skipReadBytes);
79
- $this->skipReadBytes = \max(0, $this->skipReadBytes - $len);
80
  }
 
81
  $data .= $remoteData;
82
  $this->stream->write($remoteData);
83
  }
 
84
  return $data;
85
  }
 
86
  public function write($string)
87
  {
88
  // When appending to the end of the currently read stream, you'll want
89
  // to skip bytes from being read from the remote stream to emulate
90
  // other stream wrappers. Basically replacing bytes of data of a fixed
91
  // length.
92
- $overflow = \strlen($string) + $this->tell() - $this->remoteStream->tell();
93
  if ($overflow > 0) {
94
  $this->skipReadBytes += $overflow;
95
  }
 
96
  return $this->stream->write($string);
97
  }
 
98
  public function eof()
99
  {
100
  return $this->stream->eof() && $this->remoteStream->eof();
101
  }
 
102
  /**
103
  * Close both the remote stream and buffer stream
104
  */
@@ -106,10 +127,12 @@ class CachingStream implements \_PhpScoper5b6804f9734c8\Psr\Http\Message\StreamI
106
  {
107
  $this->remoteStream->close() && $this->stream->close();
108
  }
 
109
  private function cacheEntireStream()
110
  {
111
- $target = new \_PhpScoper5b6804f9734c8\GuzzleHttp\Psr7\FnStream(['write' => 'strlen']);
112
  copy_to_stream($this, $target);
 
113
  return $this->tell();
114
  }
115
  }
1
  <?php
2
+ namespace GuzzleHttp\Psr7;
3
 
4
+ use Psr\Http\Message\StreamInterface;
5
 
 
6
  /**
7
  * Stream decorator that can cache previously read bytes from a sequentially
8
  * read stream.
9
  */
10
+ class CachingStream implements StreamInterface
11
  {
12
  use StreamDecoratorTrait;
13
+
14
  /** @var StreamInterface Stream being wrapped */
15
  private $remoteStream;
16
+
17
  /** @var int Number of bytes to skip reading due to a write on the buffer */
18
  private $skipReadBytes = 0;
19
+
20
  /**
21
  * We will treat the buffer object as the body of the stream
22
  *
23
  * @param StreamInterface $stream Stream to cache
24
  * @param StreamInterface $target Optionally specify where data is cached
25
  */
26
+ public function __construct(
27
+ StreamInterface $stream,
28
+ StreamInterface $target = null
29
+ ) {
30
  $this->remoteStream = $stream;
31
+ $this->stream = $target ?: new Stream(fopen('php://temp', 'r+'));
32
  }
33
+
34
  public function getSize()
35
  {
36
+ return max($this->stream->getSize(), $this->remoteStream->getSize());
37
  }
38
+
39
  public function rewind()
40
  {
41
  $this->seek(0);
42
  }
43
+
44
+ public function seek($offset, $whence = SEEK_SET)
45
  {
46
+ if ($whence == SEEK_SET) {
47
  $byte = $offset;
48
+ } elseif ($whence == SEEK_CUR) {
49
  $byte = $offset + $this->tell();
50
+ } elseif ($whence == SEEK_END) {
51
  $size = $this->remoteStream->getSize();
52
  if ($size === null) {
53
  $size = $this->cacheEntireStream();
56
  } else {
57
  throw new \InvalidArgumentException('Invalid whence');
58
  }
59
+
60
  $diff = $byte - $this->stream->getSize();
61
+
62
  if ($diff > 0) {
63
  // Read the remoteStream until we have read in at least the amount
64
  // of bytes requested, or we reach the end of the file.
71
  $this->stream->seek($byte);
72
  }
73
  }
74
+
75
  public function read($length)
76
  {
77
  // Perform a regular read on any previously read data from the buffer
78
  $data = $this->stream->read($length);
79
+ $remaining = $length - strlen($data);
80
+
81
  // More data was requested so read from the remote stream
82
  if ($remaining) {
83
  // If data was written to the buffer in a position that would have
84
  // been filled from the remote stream, then we must skip bytes on
85
  // the remote stream to emulate overwriting bytes from that
86
  // position. This mimics the behavior of other PHP stream wrappers.
87
+ $remoteData = $this->remoteStream->read(
88
+ $remaining + $this->skipReadBytes
89
+ );
90
+
91
  if ($this->skipReadBytes) {
92
+ $len = strlen($remoteData);
93
+ $remoteData = substr($remoteData, $this->skipReadBytes);
94
+ $this->skipReadBytes = max(0, $this->skipReadBytes - $len);
95
  }
96
+
97
  $data .= $remoteData;
98
  $this->stream->write($remoteData);
99
  }
100
+
101
  return $data;
102
  }
103
+
104
  public function write($string)
105
  {
106
  // When appending to the end of the currently read stream, you'll want
107
  // to skip bytes from being read from the remote stream to emulate
108
  // other stream wrappers. Basically replacing bytes of data of a fixed
109
  // length.
110
+ $overflow = (strlen($string) + $this->tell()) - $this->remoteStream->tell();
111
  if ($overflow > 0) {
112
  $this->skipReadBytes += $overflow;
113
  }
114
+
115
  return $this->stream->write($string);
116
  }
117
+
118
  public function eof()
119
  {
120
  return $this->stream->eof() && $this->remoteStream->eof();
121
  }
122
+
123
  /**
124
  * Close both the remote stream and buffer stream
125
  */
127
  {
128
  $this->remoteStream->close() && $this->stream->close();
129
  }
130
+
131
  private function cacheEntireStream()
132
  {
133
+ $target = new FnStream(['write' => 'strlen']);
134
  copy_to_stream($this, $target);
135
+
136
  return $this->tell();
137
  }
138
  }
includes/mollie-api-php/vendor/guzzlehttp/psr7/src/DroppingStream.php CHANGED
@@ -1,36 +1,42 @@
1
  <?php
 
2
 
3
- namespace _PhpScoper5b6804f9734c8\GuzzleHttp\Psr7;
4
 
5
- use _PhpScoper5b6804f9734c8\Psr\Http\Message\StreamInterface;
6
  /**
7
  * Stream decorator that begins dropping data once the size of the underlying
8
  * stream becomes too full.
9
  */
10
- class DroppingStream implements \_PhpScoper5b6804f9734c8\Psr\Http\Message\StreamInterface
11
  {
12
  use StreamDecoratorTrait;
 
13
  private $maxLength;
 
14
  /**
15
  * @param StreamInterface $stream Underlying stream to decorate.
16
  * @param int $maxLength Maximum size before dropping data.
17
  */
18
- public function __construct(\_PhpScoper5b6804f9734c8\Psr\Http\Message\StreamInterface $stream, $maxLength)
19
  {
20
  $this->stream = $stream;
21
  $this->maxLength = $maxLength;
22
  }
 
23
  public function write($string)
24
  {
25
  $diff = $this->maxLength - $this->stream->getSize();
 
26
  // Begin returning 0 when the underlying stream is too large.
27
  if ($diff <= 0) {
28
  return 0;
29
  }
 
30
  // Write the stream or a subset of the stream if needed.
31
- if (\strlen($string) < $diff) {
32
  return $this->stream->write($string);
33
  }
34
- return $this->stream->write(\substr($string, 0, $diff));
 
35
  }
36
  }
1
  <?php
2
+ namespace GuzzleHttp\Psr7;
3
 
4
+ use Psr\Http\Message\StreamInterface;
5
 
 
6
  /**
7
  * Stream decorator that begins dropping data once the size of the underlying
8
  * stream becomes too full.
9
  */
10
+ class DroppingStream implements StreamInterface
11
  {
12
  use StreamDecoratorTrait;
13
+
14
  private $maxLength;
15
+
16
  /**
17
  * @param StreamInterface $stream Underlying stream to decorate.
18
  * @param int $maxLength Maximum size before dropping data.
19
  */
20
+ public function __construct(StreamInterface $stream, $maxLength)
21
  {
22
  $this->stream = $stream;
23
  $this->maxLength = $maxLength;
24
  }
25
+
26
  public function write($string)
27
  {
28
  $diff = $this->maxLength - $this->stream->getSize();
29
+
30
  // Begin returning 0 when the underlying stream is too large.
31
  if ($diff <= 0) {
32
  return 0;
33
  }
34
+
35
  // Write the stream or a subset of the stream if needed.
36
+ if (strlen($string) < $diff) {
37
  return $this->stream->write($string);
38
  }
39
+
40
+ return $this->stream->write(substr($string, 0, $diff));
41
  }
42
  }
includes/mollie-api-php/vendor/guzzlehttp/psr7/src/FnStream.php CHANGED
@@ -1,48 +1,57 @@
1
  <?php
 
2
 
3
- namespace _PhpScoper5b6804f9734c8\GuzzleHttp\Psr7;
4
 
5
- use _PhpScoper5b6804f9734c8\Psr\Http\Message\StreamInterface;
6
  /**
7
  * Compose stream implementations based on a hash of functions.
8
  *
9
  * Allows for easy testing and extension of a provided stream without needing
10
  * to create a concrete class for a simple extension point.
11
  */
12
- class FnStream implements \_PhpScoper5b6804f9734c8\Psr\Http\Message\StreamInterface
13
  {
14
  /** @var array */
15
  private $methods;
 
16
  /** @var array Methods that must be implemented in the given array */
17
- private static $slots = ['__toString', 'close', 'detach', 'rewind', 'getSize', 'tell', 'eof', 'isSeekable', 'seek', 'isWritable', 'write', 'isReadable', 'read', 'getContents', 'getMetadata'];
 
 
 
18
  /**
19
  * @param array $methods Hash of method name to a callable.
20
  */
21
  public function __construct(array $methods)
22
  {
23
  $this->methods = $methods;
 
24
  // Create the functions on the class
25
  foreach ($methods as $name => $fn) {
26
  $this->{'_fn_' . $name} = $fn;
27
  }
28
  }
 
29
  /**
30
  * Lazily determine which methods are not implemented.
31
  * @throws \BadMethodCallException
32
  */
33
  public function __get($name)
34
  {
35
- throw new \BadMethodCallException(\str_replace('_fn_', '', $name) . '() is not implemented in the FnStream');
 
36
  }
 
37
  /**
38
  * The close method is called on the underlying stream only if possible.
39
  */
40
  public function __destruct()
41
  {
42
  if (isset($this->_fn_close)) {
43
- \call_user_func($this->_fn_close);
44
  }
45
  }
 
46
  /**
47
  * Adds custom functionality to an underlying stream by intercepting
48
  * specific method calls.
@@ -52,73 +61,89 @@ class FnStream implements \_PhpScoper5b6804f9734c8\Psr\Http\Message\StreamInterf
52
  *
53
  * @return FnStream
54
  */
55
- public static function decorate(\_PhpScoper5b6804f9734c8\Psr\Http\Message\StreamInterface $stream, array $methods)
56
  {
57
  // If any of the required methods were not provided, then simply
58
  // proxy to the decorated stream.
59
- foreach (\array_diff(self::$slots, \array_keys($methods)) as $diff) {
60
  $methods[$diff] = [$stream, $diff];
61
  }
 
62
  return new self($methods);
63
  }
 
64
  public function __toString()
65
  {
66
- return \call_user_func($this->_fn___toString);
67
  }
 
68
  public function close()
69
  {
70
- return \call_user_func($this->_fn_close);
71
  }
 
72
  public function detach()
73
  {
74
- return \call_user_func($this->_fn_detach);
75
  }
 
76
  public function getSize()
77
  {
78
- return \call_user_func($this->_fn_getSize);
79
  }
 
80
  public function tell()
81
  {
82
- return \call_user_func($this->_fn_tell);
83
  }
 
84
  public function eof()
85
  {
86
- return \call_user_func($this->_fn_eof);
87
  }
 
88
  public function isSeekable()
89
  {
90
- return \call_user_func($this->_fn_isSeekable);
91
  }
 
92
  public function rewind()
93
  {
94
- \call_user_func($this->_fn_rewind);
95
  }
96
- public function seek($offset, $whence = \SEEK_SET)
 
97
  {
98
- \call_user_func($this->_fn_seek, $offset, $whence);
99
  }
 
100
  public function isWritable()
101
  {
102
- return \call_user_func($this->_fn_isWritable);
103
  }
 
104
  public function write($string)
105
  {
106
- return \call_user_func($this->_fn_write, $string);
107
  }
 
108
  public function isReadable()
109
  {
110
- return \call_user_func($this->_fn_isReadable);
111
  }
 
112
  public function read($length)
113
  {
114
- return \call_user_func($this->_fn_read, $length);
115
  }
 
116
  public function getContents()
117
  {
118
- return \call_user_func($this->_fn_getContents);
119
  }
 
120
  public function getMetadata($key = null)
121
  {
122
- return \call_user_func($this->_fn_getMetadata, $key);
123
  }
124
  }
1
  <?php
2
+ namespace GuzzleHttp\Psr7;
3
 
4
+ use Psr\Http\Message\StreamInterface;
5
 
 
6
  /**
7
  * Compose stream implementations based on a hash of functions.
8
  *
9
  * Allows for easy testing and extension of a provided stream without needing
10
  * to create a concrete class for a simple extension point.
11
  */
12
+ class FnStream implements StreamInterface
13
  {
14
  /** @var array */
15
  private $methods;
16
+
17
  /** @var array Methods that must be implemented in the given array */
18
+ private static $slots = ['__toString', 'close', 'detach', 'rewind',
19
+ 'getSize', 'tell', 'eof', 'isSeekable', 'seek', 'isWritable', 'write',
20
+ 'isReadable', 'read', 'getContents', 'getMetadata'];
21
+
22
  /**
23
  * @param array $methods Hash of method name to a callable.
24
  */
25
  public function __construct(array $methods)
26
  {
27
  $this->methods = $methods;
28
+
29
  // Create the functions on the class
30
  foreach ($methods as $name => $fn) {
31
  $this->{'_fn_' . $name} = $fn;
32
  }
33
  }
34
+
35
  /**
36
  * Lazily determine which methods are not implemented.
37
  * @throws \BadMethodCallException
38
  */
39
  public function __get($name)
40
  {
41
+ throw new \BadMethodCallException(str_replace('_fn_', '', $name)
42
+ . '() is not implemented in the FnStream');
43
  }
44
+
45
  /**
46
  * The close method is called on the underlying stream only if possible.
47
  */
48
  public function __destruct()
49
  {
50
  if (isset($this->_fn_close)) {
51
+ call_user_func($this->_fn_close);
52
  }
53
  }
54
+
55
  /**
56
  * Adds custom functionality to an underlying stream by intercepting
57
  * specific method calls.
61
  *
62
  * @return FnStream
63
  */
64
+ public static function decorate(StreamInterface $stream, array $methods)
65
  {
66
  // If any of the required methods were not provided, then simply
67
  // proxy to the decorated stream.
68
+ foreach (array_diff(self::$slots, array_keys($methods)) as $diff) {
69
  $methods[$diff] = [$stream, $diff];
70
  }
71
+
72
  return new self($methods);
73
  }
74
+
75
  public function __toString()
76
  {
77
+ return call_user_func($this->_fn___toString);
78
  }
79
+
80
  public function close()
81
  {
82
+ return call_user_func($this->_fn_close);
83
  }
84
+
85
  public function detach()
86
  {
87
+ return call_user_func($this->_fn_detach);
88
  }
89
+
90
  public function getSize()
91
  {
92
+ return call_user_func($this->_fn_getSize);
93
  }
94
+
95
  public function tell()
96
  {
97
+ return call_user_func($this->_fn_tell);
98
  }
99
+
100
  public function eof()
101
  {
102
+ return call_user_func($this->_fn_eof);
103
  }
104
+
105
  public function isSeekable()
106
  {
107
+ return call_user_func($this->_fn_isSeekable);
108
  }
109
+
110
  public function rewind()
111
  {
112
+ call_user_func($this->_fn_rewind);
113
  }
114
+
115
+ public function seek($offset, $whence = SEEK_SET)
116
  {
117
+ call_user_func($this->_fn_seek, $offset, $whence);
118
  }
119
+
120
  public function isWritable()
121
  {
122
+ return call_user_func($this->_fn_isWritable);
123
  }
124
+
125
  public function write($string)
126
  {
127
+ return call_user_func($this->_fn_write, $string);
128
  }
129
+
130
  public function isReadable()
131
  {
132
+ return call_user_func($this->_fn_isReadable);
133
  }
134
+
135
  public function read($length)
136
  {
137
+ return call_user_func($this->_fn_read, $length);
138
  }
139
+
140
  public function getContents()
141
  {
142
+ return call_user_func($this->_fn_getContents);
143
  }
144
+
145
  public function getMetadata($key = null)
146
  {
147
+ return call_user_func($this->_fn_getMetadata, $key);
148
  }
149
  }
includes/mollie-api-php/vendor/guzzlehttp/psr7/src/InflateStream.php CHANGED
@@ -1,8 +1,8 @@
1
  <?php
 
2
 
3
- namespace _PhpScoper5b6804f9734c8\GuzzleHttp\Psr7;
4
 
5
- use _PhpScoper5b6804f9734c8\Psr\Http\Message\StreamInterface;
6
  /**
7
  * Uses PHP's zlib.inflate filter to inflate deflate or gzipped content.
8
  *
@@ -14,35 +14,39 @@ use _PhpScoper5b6804f9734c8\Psr\Http\Message\StreamInterface;
14
  * @link http://tools.ietf.org/html/rfc1952
15
  * @link http://php.net/manual/en/filters.compression.php
16
  */
17
- class InflateStream implements \_PhpScoper5b6804f9734c8\Psr\Http\Message\StreamInterface
18
  {
19
  use StreamDecoratorTrait;
20
- public function __construct(\_PhpScoper5b6804f9734c8\Psr\Http\Message\StreamInterface $stream)
 
21
  {
22
  // read the first 10 bytes, ie. gzip header
23
  $header = $stream->read(10);
24
  $filenameHeaderLength = $this->getLengthOfPossibleFilenameHeader($stream, $header);
25
  // Skip the header, that is 10 + length of filename + 1 (nil) bytes
26
- $stream = new \_PhpScoper5b6804f9734c8\GuzzleHttp\Psr7\LimitStream($stream, -1, 10 + $filenameHeaderLength);
27
- $resource = \_PhpScoper5b6804f9734c8\GuzzleHttp\Psr7\StreamWrapper::getResource($stream);
28
- \stream_filter_append($resource, 'zlib.inflate', \STREAM_FILTER_READ);
29
- $this->stream = new \_PhpScoper5b6804f9734c8\GuzzleHttp\Psr7\Stream($resource);
30
  }
 
31
  /**
32
  * @param StreamInterface $stream
33
  * @param $header
34
  * @return int
35
  */
36
- private function getLengthOfPossibleFilenameHeader(\_PhpScoper5b6804f9734c8\Psr\Http\Message\StreamInterface $stream, $header)
37
  {
38
  $filename_header_length = 0;
39
- if (\substr(\bin2hex($header), 6, 2) === '08') {
 
40
  // we have a filename, read until nil
41
  $filename_header_length = 1;
42
- while ($stream->read(1) !== \chr(0)) {
43
  $filename_header_length++;
44
  }
45
  }
 
46
  return $filename_header_length;
47
  }
48
  }
1
  <?php
2
+ namespace GuzzleHttp\Psr7;
3
 
4
+ use Psr\Http\Message\StreamInterface;
5
 
 
6
  /**
7
  * Uses PHP's zlib.inflate filter to inflate deflate or gzipped content.
8
  *
14
  * @link http://tools.ietf.org/html/rfc1952
15
  * @link http://php.net/manual/en/filters.compression.php
16
  */
17
+ class InflateStream implements StreamInterface
18
  {
19
  use StreamDecoratorTrait;
20
+
21
+ public function __construct(StreamInterface $stream)
22
  {
23
  // read the first 10 bytes, ie. gzip header
24
  $header = $stream->read(10);
25
  $filenameHeaderLength = $this->getLengthOfPossibleFilenameHeader($stream, $header);
26
  // Skip the header, that is 10 + length of filename + 1 (nil) bytes
27
+ $stream = new LimitStream($stream, -1, 10 + $filenameHeaderLength);
28
+ $resource = StreamWrapper::getResource($stream);
29
+ stream_filter_append($resource, 'zlib.inflate', STREAM_FILTER_READ);
30
+ $this->stream = new Stream($resource);
31
  }
32
+
33
  /**
34
  * @param StreamInterface $stream
35
  * @param $header
36
  * @return int
37
  */
38
+ private function getLengthOfPossibleFilenameHeader(StreamInterface $stream, $header)
39
  {
40
  $filename_header_length = 0;
41
+
42
+ if (substr(bin2hex($header), 6, 2) === '08') {
43
  // we have a filename, read until nil
44
  $filename_header_length = 1;
45
+ while ($stream->read(1) !== chr(0)) {
46
  $filename_header_length++;
47
  }
48
  }
49
+
50
  return $filename_header_length;
51
  }
52
  }
includes/mollie-api-php/vendor/guzzlehttp/psr7/src/LazyOpenStream.php CHANGED
@@ -1,19 +1,22 @@
1
  <?php
 
2
 
3
- namespace _PhpScoper5b6804f9734c8\GuzzleHttp\Psr7;
4
 
5
- use _PhpScoper5b6804f9734c8\Psr\Http\Message\StreamInterface;
6
  /**
7
  * Lazily reads or writes to a file that is opened only after an IO operation
8
  * take place on the stream.
9
  */
10
- class LazyOpenStream implements \_PhpScoper5b6804f9734c8\Psr\Http\Message\StreamInterface
11
  {
12
  use StreamDecoratorTrait;
 
13
  /** @var string File to open */
14
  private $filename;
 
15
  /** @var string $mode */
16
  private $mode;
 
17
  /**
18
  * @param string $filename File to lazily open
19
  * @param string $mode fopen mode to use when opening the stream
@@ -23,6 +26,7 @@ class LazyOpenStream implements \_PhpScoper5b6804f9734c8\Psr\Http\Message\Stream
23
  $this->filename = $filename;
24
  $this->mode = $mode;
25
  }
 
26
  /**
27
  * Creates the underlying stream lazily when required.
28
  *
1
  <?php
2
+ namespace GuzzleHttp\Psr7;
3
 
4
+ use Psr\Http\Message\StreamInterface;
5
 
 
6
  /**
7
  * Lazily reads or writes to a file that is opened only after an IO operation
8
  * take place on the stream.
9
  */
10
+ class LazyOpenStream implements StreamInterface
11
  {
12
  use StreamDecoratorTrait;
13
+
14
  /** @var string File to open */
15
  private $filename;
16
+
17
  /** @var string $mode */
18
  private $mode;
19
+
20
  /**
21
  * @param string $filename File to lazily open
22
  * @param string $mode fopen mode to use when opening the stream
26
  $this->filename = $filename;
27
  $this->mode = $mode;
28
  }
29
+
30
  /**
31
  * Creates the underlying stream lazily when required.
32
  *
includes/mollie-api-php/vendor/guzzlehttp/psr7/src/LimitStream.php CHANGED
@@ -1,18 +1,22 @@
1
  <?php
 
 
 
2
 
3
- namespace _PhpScoper5b6804f9734c8\GuzzleHttp\Psr7;
4
 
5
- use _PhpScoper5b6804f9734c8\Psr\Http\Message\StreamInterface;
6
  /**
7
  * Decorator used to return only a subset of a stream
8
  */
9
- class LimitStream implements \_PhpScoper5b6804f9734c8\Psr\Http\Message\StreamInterface
10
  {
11
  use StreamDecoratorTrait;
 
12
  /** @var int Offset to start reading from */
13
  private $offset;
 
14
  /** @var int Limit the number of bytes that can be read */
15
  private $limit;
 
16
  /**
17
  * @param StreamInterface $stream Stream to wrap
18
  * @param int $limit Total number of bytes to allow to be read
@@ -20,24 +24,31 @@ class LimitStream implements \_PhpScoper5b6804f9734c8\Psr\Http\Message\StreamInt
20
  * @param int $offset Position to seek to before reading (only
21
  * works on seekable streams).
22
  */
23
- public function __construct(\_PhpScoper5b6804f9734c8\Psr\Http\Message\StreamInterface $stream, $limit = -1, $offset = 0)
24
- {
 
 
 
25
  $this->stream = $stream;
26
  $this->setLimit($limit);
27
  $this->setOffset($offset);
28
  }
 
29
  public function eof()
30
  {
31
  // Always return true if the underlying stream is EOF
32
  if ($this->stream->eof()) {
33
- return \true;
34
  }
 
35
  // No limit and the underlying stream is not at EOF
36
  if ($this->limit == -1) {
37
- return \false;
38
  }
 
39
  return $this->stream->tell() >= $this->offset + $this->limit;
40
  }
 
41
  /**
42
  * Returns the size of the limited subset of data
43
  * {@inheritdoc}
@@ -49,26 +60,35 @@ class LimitStream implements \_PhpScoper5b6804f9734c8\Psr\Http\Message\StreamInt
49
  } elseif ($this->limit == -1) {
50
  return $length - $this->offset;
51
  } else {
52
- return \min($this->limit, $length - $this->offset);
53
  }
54
  }
 
55
  /**
56
  * Allow for a bounded seek on the read limited stream
57
  * {@inheritdoc}
58
  */
59
- public function seek($offset, $whence = \SEEK_SET)
60
  {
61
- if ($whence !== \SEEK_SET || $offset < 0) {
62
- throw new \RuntimeException(\sprintf('Cannot seek to offset % with whence %s', $offset, $whence));
 
 
 
 
63
  }
 
64
  $offset += $this->offset;
 
65
  if ($this->limit !== -1) {
66
  if ($offset > $this->offset + $this->limit) {
67
  $offset = $this->offset + $this->limit;
68
  }
69
  }
 
70
  $this->stream->seek($offset);
71
  }
 
72
  /**
73
  * Give a relative tell()
74
  * {@inheritdoc}
@@ -77,6 +97,7 @@ class LimitStream implements \_PhpScoper5b6804f9734c8\Psr\Http\Message\StreamInt
77
  {
78
  return $this->stream->tell() - $this->offset;
79
  }
 
80
  /**
81
  * Set the offset to start limiting from
82
  *
@@ -87,18 +108,21 @@ class LimitStream implements \_PhpScoper5b6804f9734c8\Psr\Http\Message\StreamInt
87
  public function setOffset($offset)
88
  {
89
  $current = $this->stream->tell();
 
90
  if ($current !== $offset) {
91
  // If the stream cannot seek to the offset position, then read to it
92
  if ($this->stream->isSeekable()) {
93
  $this->stream->seek($offset);
94
  } elseif ($current > $offset) {
95
- throw new \RuntimeException("Could not seek to stream offset {$offset}");
96
  } else {
97
  $this->stream->read($offset - $current);
98
  }
99
  }
 
100
  $this->offset = $offset;
101
  }
 
102
  /**
103
  * Set the limit of bytes that the decorator allows to be read from the
104
  * stream.
@@ -110,19 +134,22 @@ class LimitStream implements \_PhpScoper5b6804f9734c8\Psr\Http\Message\StreamInt
110
  {
111
  $this->limit = $limit;
112
  }
 
113
  public function read($length)
114
  {
115
  if ($this->limit == -1) {
116
  return $this->stream->read($length);
117
  }
 
118
  // Check if the current position is less than the total allowed
119
  // bytes + original offset
120
- $remaining = $this->offset + $this->limit - $this->stream->tell();
121
  if ($remaining > 0) {
122
  // Only return the amount of requested data, ensuring that the byte
123
  // limit is not exceeded
124
- return $this->stream->read(\min($remaining, $length));
125
  }
 
126
  return '';
127
  }
128
  }
1
  <?php
2
+ namespace GuzzleHttp\Psr7;
3
+
4
+ use Psr\Http\Message\StreamInterface;
5
 
 
6
 
 
7
  /**
8
  * Decorator used to return only a subset of a stream
9
  */
10
+ class LimitStream implements StreamInterface
11
  {
12
  use StreamDecoratorTrait;
13
+
14
  /** @var int Offset to start reading from */
15
  private $offset;
16
+
17
  /** @var int Limit the number of bytes that can be read */
18
  private $limit;
19
+
20
  /**
21
  * @param StreamInterface $stream Stream to wrap
22
  * @param int $limit Total number of bytes to allow to be read
24
  * @param int $offset Position to seek to before reading (only
25
  * works on seekable streams).
26
  */
27
+ public function __construct(
28
+ StreamInterface $stream,
29
+ $limit = -1,
30
+ $offset = 0
31
+ ) {
32
  $this->stream = $stream;
33
  $this->setLimit($limit);
34
  $this->setOffset($offset);
35
  }
36
+
37
  public function eof()
38
  {
39
  // Always return true if the underlying stream is EOF
40
  if ($this->stream->eof()) {
41
+ return true;
42
  }
43
+
44
  // No limit and the underlying stream is not at EOF
45
  if ($this->limit == -1) {
46
+ return false;
47
  }
48
+
49
  return $this->stream->tell() >= $this->offset + $this->limit;
50
  }
51
+
52
  /**
53
  * Returns the size of the limited subset of data
54
  * {@inheritdoc}
60
  } elseif ($this->limit == -1) {
61
  return $length - $this->offset;
62
  } else {
63
+ return min($this->limit, $length - $this->offset);
64
  }
65
  }
66
+
67
  /**
68
  * Allow for a bounded seek on the read limited stream
69
  * {@inheritdoc}
70
  */
71
+ public function seek($offset, $whence = SEEK_SET)
72
  {
73
+ if ($whence !== SEEK_SET || $offset < 0) {
74
+ throw new \RuntimeException(sprintf(
75
+ 'Cannot seek to offset % with whence %s',
76
+ $offset,
77
+ $whence
78
+ ));
79
  }
80
+
81
  $offset += $this->offset;
82
+
83
  if ($this->limit !== -1) {
84
  if ($offset > $this->offset + $this->limit) {
85
  $offset = $this->offset + $this->limit;
86
  }
87
  }
88
+
89
  $this->stream->seek($offset);
90
  }
91
+
92
  /**
93
  * Give a relative tell()
94
  * {@inheritdoc}
97
  {
98
  return $this->stream->tell() - $this->offset;
99
  }
100
+
101
  /**
102
  * Set the offset to start limiting from
103
  *
108
  public function setOffset($offset)
109
  {
110
  $current = $this->stream->tell();
111
+
112
  if ($current !== $offset) {
113
  // If the stream cannot seek to the offset position, then read to it
114
  if ($this->stream->isSeekable()) {
115
  $this->stream->seek($offset);
116
  } elseif ($current > $offset) {
117
+ throw new \RuntimeException("Could not seek to stream offset $offset");
118
  } else {
119
  $this->stream->read($offset - $current);
120
  }
121
  }
122
+
123
  $this->offset = $offset;
124
  }
125
+
126
  /**
127
  * Set the limit of bytes that the decorator allows to be read from the
128
  * stream.
134
  {
135
  $this->limit = $limit;
136
  }
137
+
138
  public function read($length)
139
  {
140
  if ($this->limit == -1) {
141
  return $this->stream->read($length);
142
  }
143
+
144
  // Check if the current position is less than the total allowed
145
  // bytes + original offset
146
+ $remaining = ($this->offset + $this->limit) - $this->stream->tell();
147
  if ($remaining > 0) {
148
  // Only return the amount of requested data, ensuring that the byte
149
  // limit is not exceeded
150
+ return $this->stream->read(min($remaining, $length));
151
  }
152
+
153
  return '';
154
  }
155
  }
includes/mollie-api-php/vendor/guzzlehttp/psr7/src/MessageTrait.php CHANGED
@@ -1,8 +1,8 @@
1
  <?php
 
2
 
3
- namespace _PhpScoper5b6804f9734c8\GuzzleHttp\Psr7;
4
 
5
- use _PhpScoper5b6804f9734c8\Psr\Http\Message\StreamInterface;
6
  /**
7
  * Trait implementing functionality common to requests and responses.
8
  */
@@ -10,123 +10,156 @@ trait MessageTrait
10
  {
11
  /** @var array Map of all registered headers, as original name => array of values */
12
  private $headers = [];
 
13
  /** @var array Map of lowercase header name => original name at registration */
14
- private $headerNames = [];
 
15
  /** @var string */
16
  private $protocol = '1.1';
 
17
  /** @var StreamInterface */
18
  private $stream;
 
19
  public function getProtocolVersion()
20
  {
21
  return $this->protocol;
22
  }
 
23
  public function withProtocolVersion($version)
24
  {
25
  if ($this->protocol === $version) {
26
  return $this;
27
  }
 
28
  $new = clone $this;
29
  $new->protocol = $version;
30
  return $new;
31
  }
 
32
  public function getHeaders()
33
  {
34
  return $this->headers;
35
  }
 
36
  public function hasHeader($header)
37
  {
38
- return isset($this->headerNames[\strtolower($header)]);
39
  }
 
40
  public function getHeader($header)
41
  {
42
- $header = \strtolower($header);
 
43
  if (!isset($this->headerNames[$header])) {
44
  return [];
45
  }
 
46
  $header = $this->headerNames[$header];
 
47
  return $this->headers[$header];
48
  }
 
49
  public function getHeaderLine($header)
50
  {
51
- return \implode(', ', $this->getHeader($header));
52
  }
 
53
  public function withHeader($header, $value)
54
  {
55
- if (!\is_array($value)) {
56
  $value = [$value];
57
  }
 
58
  $value = $this->trimHeaderValues($value);
59
- $normalized = \strtolower($header);
 
60
  $new = clone $this;
61
  if (isset($new->headerNames[$normalized])) {
62
  unset($new->headers[$new->headerNames[$normalized]]);
63
  }
64
  $new->headerNames[$normalized] = $header;
65
  $new->headers[$header] = $value;
 
66
  return $new;
67
  }
 
68
  public function withAddedHeader($header, $value)
69
  {
70
- if (!\is_array($value)) {
71
  $value = [$value];
72
  }
 
73
  $value = $this->trimHeaderValues($value);
74
- $normalized = \strtolower($header);
 
75
  $new = clone $this;
76
  if (isset($new->headerNames[$normalized])) {
77
  $header = $this->headerNames[$normalized];
78
- $new->headers[$header] = \array_merge($this->headers[$header], $value);
79
  } else {
80
  $new->headerNames[$normalized] = $header;
81
  $new->headers[$header] = $value;
82
  }
 
83
  return $new;
84
  }
 
85
  public function withoutHeader($header)
86
  {
87
- $normalized = \strtolower($header);
 
88
  if (!isset($this->headerNames[$normalized])) {
89
  return $this;
90
  }
 
91
  $header = $this->headerNames[$normalized];
 
92
  $new = clone $this;
93
  unset($new->headers[$header], $new->headerNames[$normalized]);
 
94
  return $new;
95
  }
 
96
  public function getBody()
97
  {
98
  if (!$this->stream) {
99
  $this->stream = stream_for('');
100
  }
 
101
  return $this->stream;
102
  }
103
- public function withBody(\_PhpScoper5b6804f9734c8\Psr\Http\Message\StreamInterface $body)
 
104
  {
105
  if ($body === $this->stream) {
106
  return $this;
107
  }
 
108
  $new = clone $this;
109
  $new->stream = $body;
110
  return $new;
111
  }
 
112
  private function setHeaders(array $headers)
113
  {
114
  $this->headerNames = $this->headers = [];
115
  foreach ($headers as $header => $value) {
116
- if (!\is_array($value)) {
117
  $value = [$value];
118
  }
 
119
  $value = $this->trimHeaderValues($value);
120
- $normalized = \strtolower($header);
121
  if (isset($this->headerNames[$normalized])) {
122
  $header = $this->headerNames[$normalized];
123
- $this->headers[$header] = \array_merge($this->headers[$header], $value);
124
  } else {
125
  $this->headerNames[$normalized] = $header;
126
  $this->headers[$header] = $value;
127
  }
128
  }
129
  }
 
130
  /**
131
  * Trims whitespace from the header values.
132
  *
@@ -143,8 +176,8 @@ trait MessageTrait
143
  */
144
  private function trimHeaderValues(array $values)
145
  {
146
- return \array_map(function ($value) {
147
- return \trim($value, " \t");
148
  }, $values);
149
  }
150
  }
1
  <?php
2
+ namespace GuzzleHttp\Psr7;
3
 
4
+ use Psr\Http\Message\StreamInterface;
5
 
 
6
  /**
7
  * Trait implementing functionality common to requests and responses.
8
  */
10
  {
11
  /** @var array Map of all registered headers, as original name => array of values */
12
  private $headers = [];
13
+
14
  /** @var array Map of lowercase header name => original name at registration */
15
+ private $headerNames = [];
16
+
17
  /** @var string */
18
  private $protocol = '1.1';
19
+
20
  /** @var StreamInterface */
21
  private $stream;
22
+
23
  public function getProtocolVersion()
24
  {
25
  return $this->protocol;
26
  }
27
+
28
  public function withProtocolVersion($version)
29
  {
30
  if ($this->protocol === $version) {
31
  return $this;
32
  }
33
+
34
  $new = clone $this;
35
  $new->protocol = $version;
36
  return $new;
37
  }
38
+
39
  public function getHeaders()
40
  {
41
  return $this->headers;
42
  }
43
+
44
  public function hasHeader($header)
45
  {
46
+ return isset($this->headerNames[strtolower($header)]);
47
  }
48
+
49
  public function getHeader($header)
50
  {
51
+ $header = strtolower($header);
52
+
53
  if (!isset($this->headerNames[$header])) {
54
  return [];
55
  }
56
+
57
  $header = $this->headerNames[$header];
58
+
59
  return $this->headers[$header];
60
  }
61
+
62
  public function getHeaderLine($header)
63
  {
64
+ return implode(', ', $this->getHeader($header));
65
  }
66
+
67
  public function withHeader($header, $value)
68
  {
69
+ if (!is_array($value)) {
70
  $value = [$value];
71
  }
72
+
73
  $value = $this->trimHeaderValues($value);
74
+ $normalized = strtolower($header);
75
+
76
  $new = clone $this;
77
  if (isset($new->headerNames[$normalized])) {
78
  unset($new->headers[$new->headerNames[$normalized]]);
79
  }
80
  $new->headerNames[$normalized] = $header;
81
  $new->headers[$header] = $value;
82
+
83
  return $new;
84
  }
85
+
86
  public function withAddedHeader($header, $value)
87
  {
88
+ if (!is_array($value)) {
89
  $value = [$value];
90
  }
91
+
92
  $value = $this->trimHeaderValues($value);
93
+ $normalized = strtolower($header);
94
+
95
  $new = clone $this;
96
  if (isset($new->headerNames[$normalized])) {
97
  $header = $this->headerNames[$normalized];
98
+ $new->headers[$header] = array_merge($this->headers[$header], $value);
99
  } else {
100
  $new->headerNames[$normalized] = $header;
101
  $new->headers[$header] = $value;
102
  }
103
+
104
  return $new;
105
  }
106
+
107
  public function withoutHeader($header)
108
  {
109
+ $normalized = strtolower($header);
110
+
111
  if (!isset($this->headerNames[$normalized])) {
112
  return $this;
113
  }
114
+
115
  $header = $this->headerNames[$normalized];
116
+
117
  $new = clone $this;
118
  unset($new->headers[$header], $new->headerNames[$normalized]);
119
+
120
  return $new;
121
  }
122
+
123
  public function getBody()
124
  {
125
  if (!$this->stream) {
126
  $this->stream = stream_for('');
127
  }
128
+
129
  return $this->stream;
130
  }
131
+
132
+ public function withBody(StreamInterface $body)
133
  {
134
  if ($body === $this->stream) {
135
  return $this;
136
  }
137
+
138
  $new = clone $this;
139
  $new->stream = $body;
140
  return $new;
141
  }
142
+
143
  private function setHeaders(array $headers)
144
  {
145
  $this->headerNames = $this->headers = [];
146
  foreach ($headers as $header => $value) {
147
+ if (!is_array($value)) {
148
  $value = [$value];
149
  }
150
+
151
  $value = $this->trimHeaderValues($value);
152
+ $normalized = strtolower($header);
153
  if (isset($this->headerNames[$normalized])) {
154
  $header = $this->headerNames[$normalized];
155
+ $this->headers[$header] = array_merge($this->headers[$header], $value);
156
  } else {
157
  $this->headerNames[$normalized] = $header;
158
  $this->headers[$header] = $value;
159
  }
160
  }
161
  }
162
+
163
  /**
164
  * Trims whitespace from the header values.
165
  *
176
  */
177
  private function trimHeaderValues(array $values)
178
  {
179
+ return array_map(function ($value) {
180
+ return trim($value, " \t");
181
  }, $values);
182
  }
183
  }
includes/mollie-api-php/vendor/guzzlehttp/psr7/src/MultipartStream.php CHANGED
@@ -1,16 +1,18 @@
1
  <?php
 
2
 
3
- namespace _PhpScoper5b6804f9734c8\GuzzleHttp\Psr7;
4
 
5
- use _PhpScoper5b6804f9734c8\Psr\Http\Message\StreamInterface;
6
  /**
7
  * Stream that when read returns bytes for a streaming multipart or
8
  * multipart/form-data stream.
9
  */
10
- class MultipartStream implements \_PhpScoper5b6804f9734c8\Psr\Http\Message\StreamInterface
11
  {
12
  use StreamDecoratorTrait;
 
13
  private $boundary;
 
14
  /**
15
  * @param array $elements Array of associative arrays, each containing a
16
  * required "name" key mapping to the form field,
@@ -25,9 +27,10 @@ class MultipartStream implements \_PhpScoper5b6804f9734c8\Psr\Http\Message\Strea
25
  */
26
  public function __construct(array $elements = [], $boundary = null)
27
  {
28
- $this->boundary = $boundary ?: \sha1(\uniqid('', \true));
29
  $this->stream = $this->createStream($elements);
30
  }
 
31
  /**
32
  * Get the boundary
33
  *
@@ -37,10 +40,12 @@ class MultipartStream implements \_PhpScoper5b6804f9734c8\Psr\Http\Message\Strea
37
  {
38
  return $this->boundary;
39
  }
 
40
  public function isWritable()
41
  {
42
- return \false;
43
  }
 
44
  /**
45
  * Get the headers needed before transferring the content of a POST file
46
  */
@@ -50,50 +55,71 @@ class MultipartStream implements \_PhpScoper5b6804f9734c8\Psr\Http\Message\Strea
50
  foreach ($headers as $key => $value) {
51
  $str .= "{$key}: {$value}\r\n";
52
  }
53
- return "--{$this->boundary}\r\n" . \trim($str) . "\r\n\r\n";
 
54
  }
 
55
  /**
56
  * Create the aggregate stream that will be used to upload the POST data
57
  */
58
  protected function createStream(array $elements)
59
  {
60
- $stream = new \_PhpScoper5b6804f9734c8\GuzzleHttp\Psr7\AppendStream();
 
61
  foreach ($elements as $element) {
62
  $this->addElement($stream, $element);
63
  }
 
64
  // Add the trailing boundary with CRLF
65
  $stream->addStream(stream_for("--{$this->boundary}--\r\n"));
 
66
  return $stream;
67
  }
68
- private function addElement(\_PhpScoper5b6804f9734c8\GuzzleHttp\Psr7\AppendStream $stream, array $element)
 
69
  {
70
  foreach (['contents', 'name'] as $key) {
71
- if (!\array_key_exists($key, $element)) {
72
  throw new \InvalidArgumentException("A '{$key}' key is required");
73
  }
74
  }
 
75
  $element['contents'] = stream_for($element['contents']);
 
76
  if (empty($element['filename'])) {
77
  $uri = $element['contents']->getMetadata('uri');
78
- if (\substr($uri, 0, 6) !== 'php://') {
79
  $element['filename'] = $uri;
80
  }
81
  }
82
- list($body, $headers) = $this->createElement($element['name'], $element['contents'], isset($element['filename']) ? $element['filename'] : null, isset($element['headers']) ? $element['headers'] : []);
 
 
 
 
 
 
 
83
  $stream->addStream(stream_for($this->getHeaders($headers)));
84
  $stream->addStream($body);
85
  $stream->addStream(stream_for("\r\n"));
86
  }
 
87
  /**
88
  * @return array
89
  */
90
- private function createElement($name, \_PhpScoper5b6804f9734c8\Psr\Http\Message\StreamInterface $stream, $filename, array $headers)
91
  {
92
  // Set a default content-disposition header if one was no provided
93
  $disposition = $this->getHeader($headers, 'content-disposition');
94
  if (!$disposition) {
95
- $headers['Content-Disposition'] = $filename === '0' || $filename ? \sprintf('form-data; name="%s"; filename="%s"', $name, \basename($filename)) : "form-data; name=\"{$name}\"";
 
 
 
 
96
  }
 
97
  // Set a default content-length header if one was no provided
98
  $length = $this->getHeader($headers, 'content-length');
99
  if (!$length) {
@@ -101,6 +127,7 @@ class MultipartStream implements \_PhpScoper5b6804f9734c8\Psr\Http\Message\Strea
101
  $headers['Content-Length'] = (string) $length;
102
  }
103
  }
 
104
  // Set a default Content-Type if one was not supplied
105
  $type = $this->getHeader($headers, 'content-type');
106
  if (!$type && ($filename === '0' || $filename)) {
@@ -108,16 +135,19 @@ class MultipartStream implements \_PhpScoper5b6804f9734c8\Psr\Http\Message\Strea
108
  $headers['Content-Type'] = $type;
109
  }
110
  }
 
111
  return [$stream, $headers];
112
  }
 
113
  private function getHeader(array $headers, $key)
114
  {
115
- $lowercaseHeader = \strtolower($key);
116
  foreach ($headers as $k => $v) {
117
- if (\strtolower($k) === $lowercaseHeader) {
118
  return $v;
119
  }
120
  }
 
121
  return null;
122
  }
123
  }
1
  <?php
2
+ namespace GuzzleHttp\Psr7;
3
 
4
+ use Psr\Http\Message\StreamInterface;
5
 
 
6
  /**
7
  * Stream that when read returns bytes for a streaming multipart or
8
  * multipart/form-data stream.
9
  */
10
+ class MultipartStream implements StreamInterface
11
  {
12
  use StreamDecoratorTrait;
13
+
14
  private $boundary;
15
+
16
  /**
17
  * @param array $elements Array of associative arrays, each containing a
18
  * required "name" key mapping to the form field,
27
  */
28
  public function __construct(array $elements = [], $boundary = null)
29
  {
30
+ $this->boundary = $boundary ?: sha1(uniqid('', true));
31
  $this->stream = $this->createStream($elements);
32
  }
33
+
34
  /**
35
  * Get the boundary
36
  *
40
  {
41
  return $this->boundary;
42
  }
43
+
44
  public function isWritable()
45
  {
46
+ return false;
47
  }
48
+
49
  /**
50
  * Get the headers needed before transferring the content of a POST file
51
  */
55
  foreach ($headers as $key => $value) {
56
  $str .= "{$key}: {$value}\r\n";
57
  }
58
+
59
+ return "--{$this->boundary}\r\n" . trim($str) . "\r\n\r\n";
60
  }
61
+
62
  /**
63
  * Create the aggregate stream that will be used to upload the POST data
64
  */
65
  protected function createStream(array $elements)
66
  {
67
+ $stream = new AppendStream();
68
+
69
  foreach ($elements as $element) {
70
  $this->addElement($stream, $element);
71
  }
72
+
73
  // Add the trailing boundary with CRLF
74
  $stream->addStream(stream_for("--{$this->boundary}--\r\n"));
75
+
76
  return $stream;
77
  }
78
+
79
+ private function addElement(AppendStream $stream, array $element)
80
  {
81
  foreach (['contents', 'name'] as $key) {
82
+ if (!array_key_exists($key, $element)) {
83
  throw new \InvalidArgumentException("A '{$key}' key is required");
84
  }
85
  }
86
+
87
  $element['contents'] = stream_for($element['contents']);
88
+
89
  if (empty($element['filename'])) {
90
  $uri = $element['contents']->getMetadata('uri');
91
+ if (substr($uri, 0, 6) !== 'php://') {
92
  $element['filename'] = $uri;
93
  }
94
  }
95
+
96
+ list($body, $headers) = $this->createElement(
97
+ $element['name'],
98
+ $element['contents'],
99
+ isset($element['filename']) ? $element['filename'] : null,
100
+ isset($element['headers']) ? $element['headers'] : []
101
+ );
102
+
103
  $stream->addStream(stream_for($this->getHeaders($headers)));
104
  $stream->addStream($body);
105
  $stream->addStream(stream_for("\r\n"));
106
  }
107
+
108
  /**
109
  * @return array
110
  */
111
+ private function createElement($name, StreamInterface $stream, $filename, array $headers)
112
  {
113
  // Set a default content-disposition header if one was no provided
114
  $disposition = $this->getHeader($headers, 'content-disposition');
115
  if (!$disposition) {
116
+ $headers['Content-Disposition'] = ($filename === '0' || $filename)
117
+ ? sprintf('form-data; name="%s"; filename="%s"',
118
+ $name,
119
+ basename($filename))
120
+ : "form-data; name=\"{$name}\"";
121
  }
122
+
123
  // Set a default content-length header if one was no provided
124
  $length = $this->getHeader($headers, 'content-length');
125
  if (!$length) {
127
  $headers['Content-Length'] = (string) $length;
128
  }
129
  }
130
+
131
  // Set a default Content-Type if one was not supplied
132
  $type = $this->getHeader($headers, 'content-type');
133
  if (!$type && ($filename === '0' || $filename)) {
135
  $headers['Content-Type'] = $type;
136
  }
137
  }
138
+
139
  return [$stream, $headers];
140
  }
141
+
142
  private function getHeader(array $headers, $key)
143
  {
144
+ $lowercaseHeader = strtolower($key);
145
  foreach ($headers as $k => $v) {
146
+ if (strtolower($k) === $lowercaseHeader) {
147
  return $v;
148
  }
149
  }
150
+
151
  return null;
152
  }
153
  }
includes/mollie-api-php/vendor/guzzlehttp/psr7/src/NoSeekStream.php CHANGED
@@ -1,20 +1,22 @@
1
  <?php
 
2
 
3
- namespace _PhpScoper5b6804f9734c8\GuzzleHttp\Psr7;
4
 
5
- use _PhpScoper5b6804f9734c8\Psr\Http\Message\StreamInterface;
6
  /**
7
  * Stream decorator that prevents a stream from being seeked
8
  */
9
- class NoSeekStream implements \_PhpScoper5b6804f9734c8\Psr\Http\Message\StreamInterface
10
  {
11
  use StreamDecoratorTrait;
12
- public function seek($offset, $whence = \SEEK_SET)
 
13
  {
14
  throw new \RuntimeException('Cannot seek a NoSeekStream');
15
  }
 
16
  public function isSeekable()
17
  {
18
- return \false;
19
  }
20
  }
1
  <?php
2
+ namespace GuzzleHttp\Psr7;
3
 
4
+ use Psr\Http\Message\StreamInterface;
5
 
 
6
  /**
7
  * Stream decorator that prevents a stream from being seeked
8
  */
9
+ class NoSeekStream implements StreamInterface
10
  {
11
  use StreamDecoratorTrait;
12
+
13
+ public function seek($offset, $whence = SEEK_SET)
14
  {
15
  throw new \RuntimeException('Cannot seek a NoSeekStream');
16
  }
17
+
18
  public function isSeekable()
19
  {
20
+ return false;
21
  }
22
  }
includes/mollie-api-php/vendor/guzzlehttp/psr7/src/PumpStream.php CHANGED
@@ -1,8 +1,8 @@
1
  <?php
 
2
 
3
- namespace _PhpScoper5b6804f9734c8\GuzzleHttp\Psr7;
4
 
5
- use _PhpScoper5b6804f9734c8\Psr\Http\Message\StreamInterface;
6
  /**
7
  * Provides a read only stream that pumps data from a PHP callable.
8
  *
@@ -13,18 +13,23 @@ use _PhpScoper5b6804f9734c8\Psr\Http\Message\StreamInterface;
13
  * the read() function of the PumpStream. The provided callable MUST return
14
  * false when there is no more data to read.
15
  */
16
- class PumpStream implements \_PhpScoper5b6804f9734c8\Psr\Http\Message\StreamInterface
17
  {
18
  /** @var callable */
19
  private $source;
 
20
  /** @var int */
21
  private $size;
 
22
  /** @var int */
23
  private $tellPos = 0;
 
24
  /** @var array */
25
  private $metadata;
 
26
  /** @var BufferStream */
27
  private $buffer;
 
28
  /**
29
  * @param callable $source Source of the stream data. The callable MAY
30
  * accept an integer argument used to control the
@@ -40,8 +45,9 @@ class PumpStream implements \_PhpScoper5b6804f9734c8\Psr\Http\Message\StreamInte
40
  $this->source = $source;
41
  $this->size = isset($options['size']) ? $options['size'] : null;
42
  $this->metadata = isset($options['metadata']) ? $options['metadata'] : [];
43
- $this->buffer = new \_PhpScoper5b6804f9734c8\GuzzleHttp\Psr7\BufferStream();
44
  }
 
45
  public function __toString()
46
  {
47
  try {
@@ -50,90 +56,109 @@ class PumpStream implements \_PhpScoper5b6804f9734c8\Psr\Http\Message\StreamInte
50
  return '';
51
  }
52
  }
 
53
  public function close()
54
  {
55
  $this->detach();
56
  }
 
57
  public function detach()
58
  {
59
- $this->tellPos = \false;
60
  $this->source = null;
61
  }
 
62
  public function getSize()
63
  {
64
  return $this->size;
65
  }
 
66
  public function tell()
67
  {
68
  return $this->tellPos;
69
  }
 
70
  public function eof()
71
  {
72
  return !$this->source;
73
  }
 
74
  public function isSeekable()
75
  {
76
- return \false;
77
  }
 
78
  public function rewind()
79
  {
80
  $this->seek(0);
81
  }
82
- public function seek($offset, $whence = \SEEK_SET)
 
83
  {
84
  throw new \RuntimeException('Cannot seek a PumpStream');
85
  }
 
86
  public function isWritable()
87
  {
88
- return \false;
89
  }
 
90
  public function write($string)
91
  {
92
  throw new \RuntimeException('Cannot write to a PumpStream');
93
  }
 
94
  public function isReadable()
95
  {
96
- return \true;
97
  }
 
98
  public function read($length)
99
  {
100
  $data = $this->buffer->read($length);
101
- $readLen = \strlen($data);
102
  $this->tellPos += $readLen;
103
  $remaining = $length - $readLen;
 
104
  if ($remaining) {
105
  $this->pump($remaining);
106
  $data .= $this->buffer->read($remaining);
107
- $this->tellPos += \strlen($data) - $readLen;
108
  }
 
109
  return $data;
110
  }
 
111
  public function getContents()
112
  {
113
  $result = '';
114
  while (!$this->eof()) {
115
  $result .= $this->read(1000000);
116
  }
 
117
  return $result;
118
  }
 
119
  public function getMetadata($key = null)
120
  {
121
  if (!$key) {
122
  return $this->metadata;
123
  }
 
124
  return isset($this->metadata[$key]) ? $this->metadata[$key] : null;
125
  }
 
126
  private function pump($length)
127
  {
128
  if ($this->source) {
129
  do {
130
- $data = \call_user_func($this->source, $length);
131
- if ($data === \false || $data === null) {
132
  $this->source = null;
133
  return;
134
  }
135
  $this->buffer->write($data);
136
- $length -= \strlen($data);
137
  } while ($length > 0);
138
  }
139
  }
1
  <?php
2
+ namespace GuzzleHttp\Psr7;
3
 
4
+ use Psr\Http\Message\StreamInterface;
5
 
 
6
  /**
7
  * Provides a read only stream that pumps data from a PHP callable.
8
  *
13
  * the read() function of the PumpStream. The provided callable MUST return
14
  * false when there is no more data to read.
15
  */
16
+ class PumpStream implements StreamInterface
17
  {
18
  /** @var callable */
19
  private $source;
20
+
21
  /** @var int */
22
  private $size;
23
+
24
  /** @var int */
25
  private $tellPos = 0;
26
+
27
  /** @var array */
28
  private $metadata;
29
+
30
  /** @var BufferStream */
31
  private $buffer;
32
+
33
  /**
34
  * @param callable $source Source of the stream data. The callable MAY
35
  * accept an integer argument used to control the
45
  $this->source = $source;
46
  $this->size = isset($options['size']) ? $options['size'] : null;
47
  $this->metadata = isset($options['metadata']) ? $options['metadata'] : [];
48
+ $this->buffer = new BufferStream();
49
  }
50
+
51
  public function __toString()
52
  {
53
  try {
56
  return '';
57
  }
58
  }
59
+
60
  public function close()
61
  {
62
  $this->detach();
63
  }
64
+
65
  public function detach()
66
  {
67
+ $this->tellPos = false;
68
  $this->source = null;
69
  }
70
+
71
  public function getSize()
72
  {
73
  return $this->size;
74
  }
75
+
76
  public function tell()
77
  {
78
  return $this->tellPos;
79
  }
80
+
81
  public function eof()
82
  {
83
  return !$this->source;
84
  }
85
+
86
  public function isSeekable()
87
  {
88
+ return false;
89
  }
90
+
91
  public function rewind()
92
  {
93
  $this->seek(0);
94
  }
95
+
96
+ public function seek($offset, $whence = SEEK_SET)
97
  {
98
  throw new \RuntimeException('Cannot seek a PumpStream');
99
  }
100
+
101
  public function isWritable()
102
  {
103
+ return false;
104
  }
105
+
106
  public function write($string)
107
  {
108
  throw new \RuntimeException('Cannot write to a PumpStream');
109
  }
110
+
111
  public function isReadable()
112
  {
113
+ return true;
114
  }
115
+
116
  public function read($length)
117
  {
118
  $data = $this->buffer->read($length);
119
+ $readLen = strlen($data);
120
  $this->tellPos += $readLen;
121
  $remaining = $length - $readLen;
122
+
123
  if ($remaining) {
124
  $this->pump($remaining);
125
  $data .= $this->buffer->read($remaining);
126
+ $this->tellPos += strlen($data) - $readLen;
127
  }
128
+
129
  return $data;
130
  }
131
+
132
  public function getContents()
133
  {
134
  $result = '';
135
  while (!$this->eof()) {
136
  $result .= $this->read(1000000);
137
  }
138
+
139
  return $result;
140
  }
141
+
142
  public function getMetadata($key = null)
143
  {
144
  if (!$key) {
145
  return $this->metadata;
146
  }
147
+
148
  return isset($this->metadata[$key]) ? $this->metadata[$key] : null;
149
  }
150
+
151
  private function pump($length)
152
  {
153
  if ($this->source) {
154
  do {
155
+ $data = call_user_func($this->source, $length);
156
+ if ($data === false || $data === null) {
157
  $this->source = null;
158
  return;
159
  }
160
  $this->buffer->write($data);
161
+ $length -= strlen($data);
162
  } while ($length > 0);
163
  }
164
  }
includes/mollie-api-php/vendor/guzzlehttp/psr7/src/Request.php CHANGED
@@ -1,23 +1,27 @@
1
  <?php
2
-
3
- namespace _PhpScoper5b6804f9734c8\GuzzleHttp\Psr7;
4
 
5
  use InvalidArgumentException;
6
- use _PhpScoper5b6804f9734c8\Psr\Http\Message\RequestInterface;
7
- use _PhpScoper5b6804f9734c8\Psr\Http\Message\StreamInterface;
8
- use _PhpScoper5b6804f9734c8\Psr\Http\Message\UriInterface;
 
9
  /**
10
  * PSR-7 request implementation.
11
  */
12
- class Request implements \_PhpScoper5b6804f9734c8\Psr\Http\Message\RequestInterface
13
  {
14
  use MessageTrait;
 
15
  /** @var string */
16
  private $method;
 
17
  /** @var null|string */
18
  private $requestTarget;
 
19
  /** @var UriInterface */
20
  private $uri;
 
21
  /**
22
  * @param string $method HTTP method
23
  * @param string|UriInterface $uri URI
@@ -25,27 +29,37 @@ class Request implements \_PhpScoper5b6804f9734c8\Psr\Http\Message\RequestInterf
25
  * @param string|null|resource|StreamInterface $body Request body
26
  * @param string $version Protocol version
27
  */
28
- public function __construct($method, $uri, array $headers = [], $body = null, $version = '1.1')
29
- {
30
- if (!$uri instanceof \_PhpScoper5b6804f9734c8\Psr\Http\Message\UriInterface) {
31
- $uri = new \_PhpScoper5b6804f9734c8\GuzzleHttp\Psr7\Uri($uri);
 
 
 
 
 
32
  }
33
- $this->method = \strtoupper($method);
 
34
  $this->uri = $uri;
35
  $this->setHeaders($headers);
36
  $this->protocol = $version;
 
37
  if (!$this->hasHeader('Host')) {
38
  $this->updateHostFromUri();
39
  }
 
40
  if ($body !== '' && $body !== null) {
41
  $this->stream = stream_for($body);
42
  }
43
  }
 
44
  public function getRequestTarget()
45
  {
46
  if ($this->requestTarget !== null) {
47
  return $this->requestTarget;
48
  }
 
49
  $target = $this->uri->getPath();
50
  if ($target == '') {
51
  $target = '/';
@@ -53,52 +67,68 @@ class Request implements \_PhpScoper5b6804f9734c8\Psr\Http\Message\RequestInterf
53
  if ($this->uri->getQuery() != '') {
54
  $target .= '?' . $this->uri->getQuery();
55
  }
 
56
  return $target;
57
  }
 
58
  public function withRequestTarget($requestTarget)
59
  {
60
- if (\preg_match('#\\s#', $requestTarget)) {
61
- throw new \InvalidArgumentException('Invalid request target provided; cannot contain whitespace');
 
 
62
  }
 
63
  $new = clone $this;
64
  $new->requestTarget = $requestTarget;
65
  return $new;
66
  }
 
67
  public function getMethod()
68
  {
69
  return $this->method;
70
  }
 
71
  public function withMethod($method)
72
  {
73
  $new = clone $this;
74
- $new->method = \strtoupper($method);
75
  return $new;
76
  }
 
77
  public function getUri()
78
  {
79
  return $this->uri;
80
  }
81
- public function withUri(\_PhpScoper5b6804f9734c8\Psr\Http\Message\UriInterface $uri, $preserveHost = \false)
 
82
  {
83
  if ($uri === $this->uri) {
84
  return $this;
85
  }
 
86
  $new = clone $this;
87
  $new->uri = $uri;
 
88
  if (!$preserveHost) {
89
  $new->updateHostFromUri();
90
  }
 
91
  return $new;
92
  }
 
93
  private function updateHostFromUri()
94
  {
95
  $host = $this->uri->getHost();
 
96
  if ($host == '') {
97
  return;
98
  }
 
99
  if (($port = $this->uri->getPort()) !== null) {
100
  $host .= ':' . $port;
101
  }
 
102
  if (isset($this->headerNames['host'])) {
103
  $header = $this->headerNames['host'];
104
  } else {
1
  <?php
2
+ namespace GuzzleHttp\Psr7;
 
3
 
4
  use InvalidArgumentException;
5
+ use Psr\Http\Message\RequestInterface;
6
+ use Psr\Http\Message\StreamInterface;
7
+ use Psr\Http\Message\UriInterface;
8
+
9
  /**
10
  * PSR-7 request implementation.
11
  */
12
+ class Request implements RequestInterface
13
  {
14
  use MessageTrait;
15
+
16
  /** @var string */
17
  private $method;
18
+
19
  /** @var null|string */
20
  private $requestTarget;
21
+
22
  /** @var UriInterface */
23
  private $uri;
24
+
25
  /**
26
  * @param string $method HTTP method
27
  * @param string|UriInterface $uri URI
29
  * @param string|null|resource|StreamInterface $body Request body
30
  * @param string $version Protocol version
31
  */
32
+ public function __construct(
33
+ $method,
34
+ $uri,
35
+ array $headers = [],
36
+ $body = null,
37
+ $version = '1.1'
38
+ ) {
39
+ if (!($uri instanceof UriInterface)) {
40
+ $uri = new Uri($uri);
41
  }
42
+
43
+ $this->method = strtoupper($method);
44
  $this->uri = $uri;
45
  $this->setHeaders($headers);
46
  $this->protocol = $version;
47
+
48
  if (!$this->hasHeader('Host')) {
49
  $this->updateHostFromUri();
50
  }
51
+
52
  if ($body !== '' && $body !== null) {
53
  $this->stream = stream_for($body);
54
  }
55
  }
56
+
57
  public function getRequestTarget()
58
  {
59
  if ($this->requestTarget !== null) {
60
  return $this->requestTarget;
61
  }
62
+
63
  $target = $this->uri->getPath();
64
  if ($target == '') {
65
  $target = '/';
67
  if ($this->uri->getQuery() != '') {
68
  $target .= '?' . $this->uri->getQuery();
69
  }
70
+
71
  return $target;
72
  }
73
+
74
  public function withRequestTarget($requestTarget)
75
  {
76
+ if (preg_match('#\s#', $requestTarget)) {
77
+ throw new InvalidArgumentException(
78
+ 'Invalid request target provided; cannot contain whitespace'
79
+ );
80
  }
81
+
82
  $new = clone $this;
83
  $new->requestTarget = $requestTarget;
84
  return $new;
85
  }
86
+
87
  public function getMethod()
88
  {
89
  return $this->method;
90
  }
91
+
92
  public function withMethod($method)
93
  {
94
  $new = clone $this;
95
+ $new->method = strtoupper($method);
96
  return $new;
97
  }
98
+
99
  public function getUri()
100
  {
101
  return $this->uri;
102
  }
103
+
104
+ public function withUri(UriInterface $uri, $preserveHost = false)
105
  {
106
  if ($uri === $this->uri) {
107
  return $this;
108
  }
109
+
110
  $new = clone $this;
111
  $new->uri = $uri;
112
+
113
  if (!$preserveHost) {
114
  $new->updateHostFromUri();
115
  }
116
+
117
  return $new;
118
  }
119
+
120
  private function updateHostFromUri()
121
  {
122
  $host = $this->uri->getHost();
123
+
124
  if ($host == '') {
125
  return;
126
  }
127
+
128
  if (($port = $this->uri->getPort()) !== null) {
129
  $host .= ':' . $port;
130
  }
131
+
132
  if (isset($this->headerNames['host'])) {
133
  $header = $this->headerNames['host'];
134
  } else {
includes/mollie-api-php/vendor/guzzlehttp/psr7/src/Response.php CHANGED
@@ -1,21 +1,84 @@
1
  <?php
 
2
 
3
- namespace _PhpScoper5b6804f9734c8\GuzzleHttp\Psr7;
 
4
 
5
- use _PhpScoper5b6804f9734c8\Psr\Http\Message\ResponseInterface;
6
- use _PhpScoper5b6804f9734c8\Psr\Http\Message\StreamInterface;
7
  /**
8
  * PSR-7 response implementation.
9
  */
10
- class Response implements \_PhpScoper5b6804f9734c8\Psr\Http\Message\ResponseInterface
11
  {
12
  use MessageTrait;
 
13
  /** @var array Map of standard HTTP status code/reason phrases */
14
- private static $phrases = [100 => 'Continue', 101 => 'Switching Protocols', 102 => 'Processing', 200 => 'OK', 201 => 'Created', 202 => 'Accepted', 203 => 'Non-Authoritative Information', 204 => 'No Content', 205 => 'Reset Content', 206 => 'Partial Content', 207 => 'Multi-status', 208 => 'Already Reported', 300 => 'Multiple Choices', 301 => 'Moved Permanently', 302 => 'Found', 303 => 'See Other', 304 => 'Not Modified', 305 => 'Use Proxy', 306 => 'Switch Proxy', 307 => 'Temporary Redirect', 400 => 'Bad Request', 401 => 'Unauthorized', 402 => 'Payment Required', 403 => 'Forbidden', 404 => 'Not Found', 405 => 'Method Not Allowed', 406 => 'Not Acceptable', 407 => 'Proxy Authentication Required', 408 => 'Request Time-out', 409 => 'Conflict', 410 => 'Gone', 411 => 'Length Required', 412 => 'Precondition Failed', 413 => 'Request Entity Too Large', 414 => 'Request-URI Too Large', 415 => 'Unsupported Media Type', 416 => 'Requested range not satisfiable', 417 => 'Expectation Failed', 418 => 'I\'m a teapot', 422 => 'Unprocessable Entity', 423 => 'Locked', 424 => 'Failed Dependency', 425 => 'Unordered Collection', 426 => 'Upgrade Required', 428 => 'Precondition Required', 429 => 'Too Many Requests', 431 => 'Request Header Fields Too Large', 451 => 'Unavailable For Legal Reasons', 500 => 'Internal Server Error', 501 => 'Not Implemented', 502 => 'Bad Gateway', 503 => 'Service Unavailable', 504 => 'Gateway Time-out', 505 => 'HTTP Version not supported', 506 => 'Variant Also Negotiates', 507 => 'Insufficient Storage', 508 => 'Loop Detected', 511 => 'Network Authentication Required'];
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
15
  /** @var string */
16
  private $reasonPhrase = '';
 
17
  /** @var int */
18
  private $statusCode = 200;
 
19
  /**
20
  * @param int $status Status code
21
  * @param array $headers Response headers
@@ -23,28 +86,39 @@ class Response implements \_PhpScoper5b6804f9734c8\Psr\Http\Message\ResponseInte
23
  * @param string $version Protocol version
24
  * @param string|null $reason Reason phrase (when empty a default will be used based on the status code)
25
  */
26
- public function __construct($status = 200, array $headers = [], $body = null, $version = '1.1', $reason = null)
27
- {
 
 
 
 
 
28
  $this->statusCode = (int) $status;
 
29
  if ($body !== '' && $body !== null) {
30
  $this->stream = stream_for($body);
31
  }
 
32
  $this->setHeaders($headers);
33
  if ($reason == '' && isset(self::$phrases[$this->statusCode])) {
34
  $this->reasonPhrase = self::$phrases[$this->statusCode];
35
  } else {
36
  $this->reasonPhrase = (string) $reason;
37
  }
 
38
  $this->protocol = $version;
39
  }
 
40
  public function getStatusCode()
41
  {
42
  return $this->statusCode;
43
  }
 
44
  public function getReasonPhrase()
45
  {
46
  return $this->reasonPhrase;
47
  }
 
48
  public function withStatus($code, $reasonPhrase = '')
49
  {
50
  $new = clone $this;
1
  <?php
2
+ namespace GuzzleHttp\Psr7;
3
 
4
+ use Psr\Http\Message\ResponseInterface;
5
+ use Psr\Http\Message\StreamInterface;
6
 
 
 
7
  /**
8
  * PSR-7 response implementation.
9
  */
10
+ class Response implements ResponseInterface
11
  {
12
  use MessageTrait;
13
+
14
  /** @var array Map of standard HTTP status code/reason phrases */
15
+ private static $phrases = [
16
+ 100 => 'Continue',
17
+ 101 => 'Switching Protocols',
18
+ 102 => 'Processing',
19
+ 200 => 'OK',
20
+ 201 => 'Created',
21
+ 202 => 'Accepted',
22
+ 203 => 'Non-Authoritative Information',
23
+ 204 => 'No Content',
24
+ 205 => 'Reset Content',
25
+ 206 => 'Partial Content',
26
+ 207 => 'Multi-status',
27
+ 208 => 'Already Reported',
28
+ 300 => 'Multiple Choices',
29
+ 301 => 'Moved Permanently',
30
+ 302 => 'Found',
31
+ 303 => 'See Other',
32
+ 304 => 'Not Modified',
33
+ 305 => 'Use Proxy',
34
+ 306 => 'Switch Proxy',
35
+ 307 => 'Temporary Redirect',
36
+ 400 => 'Bad Request',
37
+ 401 => 'Unauthorized',
38
+ 402 => 'Payment Required',
39
+ 403 => 'Forbidden',
40
+ 404 => 'Not Found',
41
+ 405 => 'Method Not Allowed',
42
+ 406 => 'Not Acceptable',
43
+ 407 => 'Proxy Authentication Required',
44
+ 408 => 'Request Time-out',
45
+ 409 => 'Conflict',
46
+ 410 => 'Gone',
47
+ 411 => 'Length Required',
48
+ 412 => 'Precondition Failed',
49
+ 413 => 'Request Entity Too Large',
50
+ 414 => 'Request-URI Too Large',
51
+ 415 => 'Unsupported Media Type',
52
+ 416 => 'Requested range not satisfiable',
53
+ 417 => 'Expectation Failed',
54
+ 418 => 'I\'m a teapot',
55
+ 422 => 'Unprocessable Entity',
56
+ 423 => 'Locked',
57
+ 424 => 'Failed Dependency',
58
+ 425 => 'Unordered Collection',
59
+ 426 => 'Upgrade Required',
60
+ 428 => 'Precondition Required',
61
+ 429 => 'Too Many Requests',
62
+ 431 => 'Request Header Fields Too Large',
63
+ 451 => 'Unavailable For Legal Reasons',
64
+ 500 => 'Internal Server Error',
65
+ 501 => 'Not Implemented',
66
+ 502 => 'Bad Gateway',
67
+ 503 => 'Service Unavailable',
68
+ 504 => 'Gateway Time-out',
69
+ 505 => 'HTTP Version not supported',
70
+ 506 => 'Variant Also Negotiates',
71
+ 507 => 'Insufficient Storage',
72
+ 508 => 'Loop Detected',
73
+ 511 => 'Network Authentication Required',
74
+ ];
75
+
76
  /** @var string */
77
  private $reasonPhrase = '';
78
+
79
  /** @var int */
80
  private $statusCode = 200;
81
+
82
  /**
83
  * @param int $status Status code
84
  * @param array $headers Response headers
86
  * @param string $version Protocol version
87
  * @param string|null $reason Reason phrase (when empty a default will be used based on the status code)
88
  */
89
+ public function __construct(
90
+ $status = 200,
91
+ array $headers = [],
92
+ $body = null,
93
+ $version = '1.1',
94
+ $reason = null
95
+ ) {
96
  $this->statusCode = (int) $status;
97
+
98
  if ($body !== '' && $body !== null) {
99
  $this->stream = stream_for($body);
100
  }
101
+
102
  $this->setHeaders($headers);
103
  if ($reason == '' && isset(self::$phrases[$this->statusCode])) {
104
  $this->reasonPhrase = self::$phrases[$this->statusCode];
105
  } else {
106
  $this->reasonPhrase = (string) $reason;
107
  }
108
+
109
  $this->protocol = $version;
110
  }
111
+
112
  public function getStatusCode()
113
  {
114
  return $this->statusCode;
115
  }
116
+
117
  public function getReasonPhrase()
118
  {
119
  return $this->reasonPhrase;
120
  }
121
+
122
  public function withStatus($code, $reasonPhrase = '')
123
  {
124
  $new = clone $this;
includes/mollie-api-php/vendor/guzzlehttp/psr7/src/ServerRequest.php CHANGED
@@ -1,12 +1,13 @@
1
  <?php
2
 
3
- namespace _PhpScoper5b6804f9734c8\GuzzleHttp\Psr7;
4
 
5
  use InvalidArgumentException;
6
- use _PhpScoper5b6804f9734c8\Psr\Http\Message\ServerRequestInterface;
7
- use _PhpScoper5b6804f9734c8\Psr\Http\Message\UriInterface;
8
- use _PhpScoper5b6804f9734c8\Psr\Http\Message\StreamInterface;
9
- use _PhpScoper5b6804f9734c8\Psr\Http\Message\UploadedFileInterface;
 
10
  /**
11
  * Server-side HTTP request
12
  *
@@ -21,32 +22,38 @@ use _PhpScoper5b6804f9734c8\Psr\Http\Message\UploadedFileInterface;
21
  * implemented such that they retain the internal state of the current
22
  * message and return a new instance that contains the changed state.
23
  */
24
- class ServerRequest extends \_PhpScoper5b6804f9734c8\GuzzleHttp\Psr7\Request implements \_PhpScoper5b6804f9734c8\Psr\Http\Message\ServerRequestInterface
25
  {
26
  /**
27
  * @var array
28
  */
29
  private $attributes = [];
 
30
  /**
31
  * @var array
32
  */
33
  private $cookieParams = [];
 
34
  /**
35
  * @var null|array|object
36
  */
37
  private $parsedBody;
 
38
  /**
39
  * @var array
40
  */
41
  private $queryParams = [];
 
42
  /**
43
  * @var array
44
  */
45
  private $serverParams;
 
46
  /**
47
  * @var array
48
  */
49
  private $uploadedFiles = [];
 
50
  /**
51
  * @param string $method HTTP method
52
  * @param string|UriInterface $uri URI
@@ -55,11 +62,19 @@ class ServerRequest extends \_PhpScoper5b6804f9734c8\GuzzleHttp\Psr7\Request imp
55
  * @param string $version Protocol version
56
  * @param array $serverParams Typically the $_SERVER superglobal
57
  */
58
- public function __construct($method, $uri, array $headers = [], $body = null, $version = '1.1', array $serverParams = [])
59
- {
 
 
 
 
 
 
60
  $this->serverParams = $serverParams;
 
61
  parent::__construct($method, $uri, $headers, $body, $version);
62
  }
 
63
  /**
64
  * Return an UploadedFile instance array.
65
  *
@@ -70,20 +85,23 @@ class ServerRequest extends \_PhpScoper5b6804f9734c8\GuzzleHttp\Psr7\Request imp
70
  public static function normalizeFiles(array $files)
71
  {
72
  $normalized = [];
 
73
  foreach ($files as $key => $value) {
74
- if ($value instanceof \_PhpScoper5b6804f9734c8\Psr\Http\Message\UploadedFileInterface) {
75
  $normalized[$key] = $value;
76
- } elseif (\is_array($value) && isset($value['tmp_name'])) {
77
  $normalized[$key] = self::createUploadedFileFromSpec($value);
78
- } elseif (\is_array($value)) {
79
  $normalized[$key] = self::normalizeFiles($value);
80
  continue;
81
  } else {
82
- throw new \InvalidArgumentException('Invalid value in files specification');
83
  }
84
  }
 
85
  return $normalized;
86
  }
 
87
  /**
88
  * Create and return an UploadedFile instance from a $_FILES specification.
89
  *
@@ -95,11 +113,19 @@ class ServerRequest extends \_PhpScoper5b6804f9734c8\GuzzleHttp\Psr7\Request imp
95
  */
96
  private static function createUploadedFileFromSpec(array $value)
97
  {
98
- if (\is_array($value['tmp_name'])) {
99
  return self::normalizeNestedFileSpec($value);
100
  }
101
- return new \_PhpScoper5b6804f9734c8\GuzzleHttp\Psr7\UploadedFile($value['tmp_name'], (int) $value['size'], (int) $value['error'], $value['name'], $value['type']);
 
 
 
 
 
 
 
102
  }
 
103
  /**
104
  * Normalize an array of file specifications.
105
  *
@@ -112,12 +138,21 @@ class ServerRequest extends \_PhpScoper5b6804f9734c8\GuzzleHttp\Psr7\Request imp
112
  private static function normalizeNestedFileSpec(array $files = [])
113
  {
114
  $normalizedFiles = [];
115
- foreach (\array_keys($files['tmp_name']) as $key) {
116
- $spec = ['tmp_name' => $files['tmp_name'][$key], 'size' => $files['size'][$key], 'error' => $files['error'][$key], 'name' => $files['name'][$key], 'type' => $files['type'][$key]];
 
 
 
 
 
 
 
117
  $normalizedFiles[$key] = self::createUploadedFileFromSpec($spec);
118
  }
 
119
  return $normalizedFiles;
120
  }
 
121
  /**
122
  * Return a ServerRequest populated with superglobals:
123
  * $_GET
@@ -131,28 +166,36 @@ class ServerRequest extends \_PhpScoper5b6804f9734c8\GuzzleHttp\Psr7\Request imp
131
  public static function fromGlobals()
132
  {
133
  $method = isset($_SERVER['REQUEST_METHOD']) ? $_SERVER['REQUEST_METHOD'] : 'GET';
134
- $headers = \function_exists('_PhpScoper5b6804f9734c8\\getallheaders') ? getallheaders() : [];
135
  $uri = self::getUriFromGlobals();
136
- $body = new \_PhpScoper5b6804f9734c8\GuzzleHttp\Psr7\LazyOpenStream('php://input', 'r+');
137
- $protocol = isset($_SERVER['SERVER_PROTOCOL']) ? \str_replace('HTTP/', '', $_SERVER['SERVER_PROTOCOL']) : '1.1';
138
- $serverRequest = new \_PhpScoper5b6804f9734c8\GuzzleHttp\Psr7\ServerRequest($method, $uri, $headers, $body, $protocol, $_SERVER);
139
- return $serverRequest->withCookieParams($_COOKIE)->withQueryParams($_GET)->withParsedBody($_POST)->withUploadedFiles(self::normalizeFiles($_FILES));
 
 
 
 
 
 
140
  }
 
141
  /**
142
  * Get a Uri populated with values from $_SERVER.
143
  *
144
  * @return UriInterface
145
  */
146
- public static function getUriFromGlobals()
147
- {
148
- $uri = new \_PhpScoper5b6804f9734c8\GuzzleHttp\Psr7\Uri('');
149
  $uri = $uri->withScheme(!empty($_SERVER['HTTPS']) && $_SERVER['HTTPS'] !== 'off' ? 'https' : 'http');
150
- $hasPort = \false;
 
151
  if (isset($_SERVER['HTTP_HOST'])) {
152
- $hostHeaderParts = \explode(':', $_SERVER['HTTP_HOST']);
153
  $uri = $uri->withHost($hostHeaderParts[0]);
154
  if (isset($hostHeaderParts[1])) {
155
- $hasPort = \true;
156
  $uri = $uri->withPort($hostHeaderParts[1]);
157
  }
158
  } elseif (isset($_SERVER['SERVER_NAME'])) {
@@ -160,23 +203,29 @@ class ServerRequest extends \_PhpScoper5b6804f9734c8\GuzzleHttp\Psr7\Request imp
160
  } elseif (isset($_SERVER['SERVER_ADDR'])) {
161
  $uri = $uri->withHost($_SERVER['SERVER_ADDR']);
162
  }
 
163
  if (!$hasPort && isset($_SERVER['SERVER_PORT'])) {
164
  $uri = $uri->withPort($_SERVER['SERVER_PORT']);
165
  }
166
- $hasQuery = \false;
 
167
  if (isset($_SERVER['REQUEST_URI'])) {
168
- $requestUriParts = \explode('?', $_SERVER['REQUEST_URI']);
169
  $uri = $uri->withPath($requestUriParts[0]);
170
  if (isset($requestUriParts[1])) {
171
- $hasQuery = \true;
172
  $uri = $uri->withQuery($requestUriParts[1]);
173
  }
174
  }
 
175
  if (!$hasQuery && isset($_SERVER['QUERY_STRING'])) {
176
  $uri = $uri->withQuery($_SERVER['QUERY_STRING']);
177
  }
 
178
  return $uri;
179
  }
 
 
180
  /**
181
  * {@inheritdoc}
182
  */
@@ -184,6 +233,7 @@ class ServerRequest extends \_PhpScoper5b6804f9734c8\GuzzleHttp\Psr7\Request imp
184
  {
185
  return $this->serverParams;
186
  }
 
187
  /**
188
  * {@inheritdoc}
189
  */
@@ -191,6 +241,7 @@ class ServerRequest extends \_PhpScoper5b6804f9734c8\GuzzleHttp\Psr7\Request imp
191
  {
192
  return $this->uploadedFiles;
193
  }
 
194
  /**
195
  * {@inheritdoc}
196
  */
@@ -198,8 +249,10 @@ class ServerRequest extends \_PhpScoper5b6804f9734c8\GuzzleHttp\Psr7\Request imp
198
  {
199
  $new = clone $this;
200
  $new->uploadedFiles = $uploadedFiles;
 
201
  return $new;
202
  }
 
203
  /**
204
  * {@inheritdoc}
205
  */
@@ -207,6 +260,7 @@ class ServerRequest extends \_PhpScoper5b6804f9734c8\GuzzleHttp\Psr7\Request imp
207
  {
208
  return $this->cookieParams;
209
  }
 
210
  /**
211
  * {@inheritdoc}
212
  */
@@ -214,8 +268,10 @@ class ServerRequest extends \_PhpScoper5b6804f9734c8\GuzzleHttp\Psr7\Request imp
214
  {
215
  $new = clone $this;
216
  $new->cookieParams = $cookies;
 
217
  return $new;
218
  }
 
219
  /**
220
  * {@inheritdoc}
221
  */
@@ -223,6 +279,7 @@ class ServerRequest extends \_PhpScoper5b6804f9734c8\GuzzleHttp\Psr7\Request imp
223
  {
224
  return $this->queryParams;
225
  }
 
226
  /**
227
  * {@inheritdoc}
228
  */
@@ -230,8 +287,10 @@ class ServerRequest extends \_PhpScoper5b6804f9734c8\GuzzleHttp\Psr7\Request imp
230
  {
231
  $new = clone $this;
232
  $new->queryParams = $query;
 
233
  return $new;
234
  }
 
235
  /**
236
  * {@inheritdoc}
237
  */
@@ -239,6 +298,7 @@ class ServerRequest extends \_PhpScoper5b6804f9734c8\GuzzleHttp\Psr7\Request imp
239
  {
240
  return $this->parsedBody;
241
  }
 
242
  /**
243
  * {@inheritdoc}
244
  */
@@ -246,8 +306,10 @@ class ServerRequest extends \_PhpScoper5b6804f9734c8\GuzzleHttp\Psr7\Request imp
246
  {
247
  $new = clone $this;
248
  $new->parsedBody = $data;
 
249
  return $new;
250
  }
 
251
  /**
252
  * {@inheritdoc}
253
  */
@@ -255,16 +317,19 @@ class ServerRequest extends \_PhpScoper5b6804f9734c8\GuzzleHttp\Psr7\Request imp
255
  {
256
  return $this->attributes;
257
  }
 
258
  /**
259
  * {@inheritdoc}
260
  */
261
  public function getAttribute($attribute, $default = null)
262
  {
263
- if (\false === \array_key_exists($attribute, $this->attributes)) {
264
  return $default;
265
  }
 
266
  return $this->attributes[$attribute];
267
  }
 
268
  /**
269
  * {@inheritdoc}
270
  */
@@ -272,18 +337,22 @@ class ServerRequest extends \_PhpScoper5b6804f9734c8\GuzzleHttp\Psr7\Request imp
272
  {
273
  $new = clone $this;
274
  $new->attributes[$attribute] = $value;
 
275
  return $new;
276
  }
 
277
  /**
278
  * {@inheritdoc}
279
  */
280
  public function withoutAttribute($attribute)
281
  {
282
- if (\false === \array_key_exists($attribute, $this->attributes)) {
283
  return $this;
284
  }
 
285
  $new = clone $this;
286
  unset($new->attributes[$attribute]);
 
287
  return $new;
288
  }
289
  }
1
  <?php
2
 
3
+ namespace GuzzleHttp\Psr7;
4
 
5
  use InvalidArgumentException;
6
+ use Psr\Http\Message\ServerRequestInterface;
7
+ use Psr\Http\Message\UriInterface;
8
+ use Psr\Http\Message\StreamInterface;
9
+ use Psr\Http\Message\UploadedFileInterface;
10
+
11
  /**
12
  * Server-side HTTP request
13
  *
22
  * implemented such that they retain the internal state of the current
23
  * message and return a new instance that contains the changed state.
24
  */
25
+ class ServerRequest extends Request implements ServerRequestInterface
26
  {
27
  /**
28
  * @var array
29
  */
30
  private $attributes = [];
31
+
32
  /**
33
  * @var array
34
  */
35
  private $cookieParams = [];
36
+
37
  /**
38
  * @var null|array|object
39
  */
40
  private $parsedBody;
41
+
42
  /**
43
  * @var array
44
  */
45
  private $queryParams = [];
46
+
47
  /**
48
  * @var array
49
  */
50
  private $serverParams;
51
+
52
  /**
53
  * @var array
54
  */
55
  private $uploadedFiles = [];
56
+
57
  /**
58
  * @param string $method HTTP method
59
  * @param string|UriInterface $uri URI
62
  * @param string $version Protocol version
63
  * @param array $serverParams Typically the $_SERVER superglobal
64
  */
65
+ public function __construct(
66
+ $method,
67
+ $uri,
68
+ array $headers = [],
69
+ $body = null,
70
+ $version = '1.1',
71
+ array $serverParams = []
72
+ ) {
73
  $this->serverParams = $serverParams;
74
+
75
  parent::__construct($method, $uri, $headers, $body, $version);
76
  }
77
+
78
  /**
79
  * Return an UploadedFile instance array.
80
  *
85
  public static function normalizeFiles(array $files)
86
  {
87
  $normalized = [];
88
+
89
  foreach ($files as $key => $value) {
90
+ if ($value instanceof UploadedFileInterface) {
91
  $normalized[$key] = $value;
92
+ } elseif (is_array($value) && isset($value['tmp_name'])) {
93
  $normalized[$key] = self::createUploadedFileFromSpec($value);
94
+ } elseif (is_array($value)) {
95
  $normalized[$key] = self::normalizeFiles($value);
96
  continue;
97
  } else {
98
+ throw new InvalidArgumentException('Invalid value in files specification');
99
  }
100
  }
101
+
102
  return $normalized;
103
  }
104
+
105
  /**
106
  * Create and return an UploadedFile instance from a $_FILES specification.
107
  *
113
  */
114
  private static function createUploadedFileFromSpec(array $value)
115
  {
116
+ if (is_array($value['tmp_name'])) {
117
  return self::normalizeNestedFileSpec($value);
118
  }
119
+
120
+ return new UploadedFile(
121
+ $value['tmp_name'],
122
+ (int) $value['size'],
123
+ (int) $value['error'],
124
+ $value['name'],
125
+ $value['type']
126
+ );
127
  }
128
+
129
  /**
130
  * Normalize an array of file specifications.
131
  *
138
  private static function normalizeNestedFileSpec(array $files = [])
139
  {
140
  $normalizedFiles = [];
141
+
142
+ foreach (array_keys($files['tmp_name']) as $key) {
143
+ $spec = [
144
+ 'tmp_name' => $files['tmp_name'][$key],
145
+ 'size' => $files['size'][$key],
146
+ 'error' => $files['error'][$key],
147
+ 'name' => $files['name'][$key],
148
+ 'type' => $files['type'][$key],
149
+ ];
150
  $normalizedFiles[$key] = self::createUploadedFileFromSpec($spec);
151
  }
152
+
153
  return $normalizedFiles;
154
  }
155
+
156
  /**
157
  * Return a ServerRequest populated with superglobals:
158
  * $_GET
166
  public static function fromGlobals()
167
  {
168
  $method = isset($_SERVER['REQUEST_METHOD']) ? $_SERVER['REQUEST_METHOD'] : 'GET';
169
+ $headers = function_exists('getallheaders') ? getallheaders() : [];
170
  $uri = self::getUriFromGlobals();
171
+ $body = new LazyOpenStream('php://input', 'r+');
172
+ $protocol = isset($_SERVER['SERVER_PROTOCOL']) ? str_replace('HTTP/', '', $_SERVER['SERVER_PROTOCOL']) : '1.1';
173
+
174
+ $serverRequest = new ServerRequest($method, $uri, $headers, $body, $protocol, $_SERVER);
175
+
176
+ return $serverRequest
177
+ ->withCookieParams($_COOKIE)
178
+ ->withQueryParams($_GET)
179
+ ->withParsedBody($_POST)
180
+ ->withUploadedFiles(self::normalizeFiles($_FILES));
181
  }
182
+
183
  /**
184
  * Get a Uri populated with values from $_SERVER.
185
  *
186
  * @return UriInterface
187
  */
188
+ public static function getUriFromGlobals() {
189
+ $uri = new Uri('');
190
+
191
  $uri = $uri->withScheme(!empty($_SERVER['HTTPS']) && $_SERVER['HTTPS'] !== 'off' ? 'https' : 'http');
192
+
193
+ $hasPort = false;
194
  if (isset($_SERVER['HTTP_HOST'])) {
195
+ $hostHeaderParts = explode(':', $_SERVER['HTTP_HOST']);
196
  $uri = $uri->withHost($hostHeaderParts[0]);
197
  if (isset($hostHeaderParts[1])) {
198
+ $hasPort = true;
199
  $uri = $uri->withPort($hostHeaderParts[1]);
200
  }
201
  } elseif (isset($_SERVER['SERVER_NAME'])) {
203
  } elseif (isset($_SERVER['SERVER_ADDR'])) {
204
  $uri = $uri->withHost($_SERVER['SERVER_ADDR']);
205
  }
206
+
207
  if (!$hasPort && isset($_SERVER['SERVER_PORT'])) {
208
  $uri = $uri->withPort($_SERVER['SERVER_PORT']);
209
  }
210
+
211
+ $hasQuery = false;
212
  if (isset($_SERVER['REQUEST_URI'])) {
213
+ $requestUriParts = explode('?', $_SERVER['REQUEST_URI']);
214
  $uri = $uri->withPath($requestUriParts[0]);
215
  if (isset($requestUriParts[1])) {
216
+ $hasQuery = true;
217
  $uri = $uri->withQuery($requestUriParts[1]);
218
  }
219
  }
220
+
221
  if (!$hasQuery && isset($_SERVER['QUERY_STRING'])) {
222
  $uri = $uri->withQuery($_SERVER['QUERY_STRING']);
223
  }
224
+
225
  return $uri;
226
  }
227
+
228
+
229
  /**
230
  * {@inheritdoc}
231
  */
233
  {
234
  return $this->serverParams;
235
  }
236
+
237
  /**
238
  * {@inheritdoc}
239
  */
241
  {
242
  return $this->uploadedFiles;
243
  }
244
+
245
  /**
246
  * {@inheritdoc}
247
  */
249
  {
250
  $new = clone $this;
251
  $new->uploadedFiles = $uploadedFiles;
252
+
253
  return $new;
254
  }
255
+
256
  /**
257
  * {@inheritdoc}
258
  */
260
  {
261
  return $this->cookieParams;
262
  }
263
+
264
  /**
265
  * {@inheritdoc}
266
  */
268
  {
269
  $new = clone $this;
270
  $new->cookieParams = $cookies;
271
+
272
  return $new;
273
  }
274
+
275
  /**
276
  * {@inheritdoc}
277
  */
279
  {
280
  return $this->queryParams;
281
  }
282
+
283
  /**
284
  * {@inheritdoc}
285
  */
287
  {
288
  $new = clone $this;
289
  $new->queryParams = $query;
290
+
291
  return $new;
292
  }
293
+
294
  /**
295
  * {@inheritdoc}
296
  */
298
  {
299
  return $this->parsedBody;
300
  }
301
+
302
  /**
303
  * {@inheritdoc}
304
  */
306
  {
307
  $new = clone $this;
308
  $new->parsedBody = $data;
309
+
310
  return $new;
311
  }
312
+
313
  /**
314
  * {@inheritdoc}
315
  */
317
  {
318
  return $this->attributes;
319
  }
320
+
321
  /**
322
  * {@inheritdoc}
323
  */
324
  public function getAttribute($attribute, $default = null)
325
  {
326
+ if (false === array_key_exists($attribute, $this->attributes)) {
327
  return $default;
328
  }
329
+
330
  return $this->attributes[$attribute];
331
  }
332
+
333
  /**
334
  * {@inheritdoc}
335
  */
337
  {
338
  $new = clone $this;
339
  $new->attributes[$attribute] = $value;
340
+
341
  return $new;
342
  }
343
+
344
  /**
345
  * {@inheritdoc}
346
  */
347
  public function withoutAttribute($attribute)
348
  {
349
+ if (false === array_key_exists($attribute, $this->attributes)) {
350
  return $this;
351
  }
352
+
353
  $new = clone $this;
354
  unset($new->attributes[$attribute]);
355
+
356
  return $new;
357
  }
358
  }
includes/mollie-api-php/vendor/guzzlehttp/psr7/src/Stream.php CHANGED
@@ -1,14 +1,14 @@
1
  <?php
 
2
 
3
- namespace _PhpScoper5b6804f9734c8\GuzzleHttp\Psr7;
4
 
5
- use _PhpScoper5b6804f9734c8\Psr\Http\Message\StreamInterface;
6
  /**
7
  * PHP stream implementation.
8
  *
9
  * @var $stream
10
  */
11
- class Stream implements \_PhpScoper5b6804f9734c8\Psr\Http\Message\StreamInterface
12
  {
13
  private $stream;
14
  private $size;
@@ -17,8 +17,23 @@ class Stream implements \_PhpScoper5b6804f9734c8\Psr\Http\Message\StreamInterfac
17
  private $writable;
18
  private $uri;
19
  private $customMetadata;
 
20
  /** @var array Hash of readable and writable stream types */
21
- private static $readWriteHash = ['read' => ['r' => \true, 'w+' => \true, 'r+' => \true, 'x+' => \true, 'c+' => \true, 'rb' => \true, 'w+b' => \true, 'r+b' => \true, 'x+b' => \true, 'c+b' => \true, 'rt' => \true, 'w+t' => \true, 'r+t' => \true, 'x+t' => \true, 'c+t' => \true, 'a+' => \true], 'write' => ['w' => \true, 'w+' => \true, 'rw' => \true, 'r+' => \true, 'x+' => \true, 'c+' => \true, 'wb' => \true, 'w+b' => \true, 'r+b' => \true, 'x+b' => \true, 'c+b' => \true, 'w+t' => \true, 'r+t' => \true, 'x+t' => \true, 'c+t' => \true, 'a' => \true, 'a+' => \true]];
 
 
 
 
 
 
 
 
 
 
 
 
 
 
22
  /**
23
  * This constructor accepts an associative array of options.
24
  *
@@ -35,27 +50,35 @@ class Stream implements \_PhpScoper5b6804f9734c8\Psr\Http\Message\StreamInterfac
35
  */
36
  public function __construct($stream, $options = [])
37
  {
38
- if (!\is_resource($stream)) {
39
  throw new \InvalidArgumentException('Stream must be a resource');
40
  }
 
41
  if (isset($options['size'])) {
42
  $this->size = $options['size'];
43
  }
44
- $this->customMetadata = isset($options['metadata']) ? $options['metadata'] : [];
 
 
 
 
45
  $this->stream = $stream;
46
- $meta = \stream_get_meta_data($this->stream);
47
  $this->seekable = $meta['seekable'];
48
  $this->readable = isset(self::$readWriteHash['read'][$meta['mode']]);
49
  $this->writable = isset(self::$readWriteHash['write'][$meta['mode']]);
50
  $this->uri = $this->getMetadata('uri');
51
  }
 
52
  public function __get($name)
53
  {
54
  if ($name == 'stream') {
55
  throw new \RuntimeException('The stream is detached');
56
  }
 
57
  throw new \BadMethodCallException('No value for ' . $name);
58
  }
 
59
  /**
60
  * Closes the stream when the destructed
61
  */
@@ -63,98 +86,122 @@ class Stream implements \_PhpScoper5b6804f9734c8\Psr\Http\Message\StreamInterfac
63
  {
64
  $this->close();
65
  }
 
66
  public function __toString()
67
  {
68
  try {
69
  $this->seek(0);
70
- return (string) \stream_get_contents($this->stream);
71
  } catch (\Exception $e) {
72
  return '';
73
  }
74
  }
 
75
  public function getContents()
76
  {
77
- $contents = \stream_get_contents($this->stream);
78
- if ($contents === \false) {
 
79
  throw new \RuntimeException('Unable to read stream contents');
80
  }
 
81
  return $contents;
82
  }
 
83
  public function close()
84
  {
85
  if (isset($this->stream)) {
86
- if (\is_resource($this->stream)) {
87
- \fclose($this->stream);
88
  }
89
  $this->detach();
90
  }
91
  }
 
92
  public function detach()
93
  {
94
  if (!isset($this->stream)) {
95
  return null;
96
  }
 
97
  $result = $this->stream;
98
  unset($this->stream);
99
  $this->size = $this->uri = null;
100
- $this->readable = $this->writable = $this->seekable = \false;
 
101
  return $result;
102
  }
 
103
  public function getSize()
104
  {
105
  if ($this->size !== null) {
106
  return $this->size;
107
  }
 
108
  if (!isset($this->stream)) {
109
  return null;
110
  }
 
111
  // Clear the stat cache if the stream has a URI
112
  if ($this->uri) {
113
- \clearstatcache(\true, $this->uri);
114
  }
115
- $stats = \fstat($this->stream);
 
116
  if (isset($stats['size'])) {
117
  $this->size = $stats['size'];
118
  return $this->size;
119
  }
 
120
  return null;
121
  }
 
122
  public function isReadable()
123
  {
124
  return $this->readable;
125
  }
 
126
  public function isWritable()
127
  {
128
  return $this->writable;
129
  }
 
130
  public function isSeekable()
131
  {
132
  return $this->seekable;
133
  }
 
134
  public function eof()
135
  {
136
- return !$this->stream || \feof($this->stream);
137
  }
 
138
  public function tell()
139
  {
140
- $result = \ftell($this->stream);
141
- if ($result === \false) {
 
142
  throw new \RuntimeException('Unable to determine stream position');
143
  }
 
144
  return $result;
145
  }
 
146
  public function rewind()
147
  {
148
  $this->seek(0);
149
  }
150
- public function seek($offset, $whence = \SEEK_SET)
 
151
  {
152
  if (!$this->seekable) {
153
  throw new \RuntimeException('Stream is not seekable');
154
- } elseif (\fseek($this->stream, $offset, $whence) === -1) {
155
- throw new \RuntimeException('Unable to seek to stream position ' . $offset . ' with whence ' . \var_export($whence, \true));
 
156
  }
157
  }
 
158
  public function read($length)
159
  {
160
  if (!$this->readable) {
@@ -163,38 +210,48 @@ class Stream implements \_PhpScoper5b6804f9734c8\Psr\Http\Message\StreamInterfac
163
  if ($length < 0) {
164
  throw new \RuntimeException('Length parameter cannot be negative');
165
  }
 
166
  if (0 === $length) {
167
  return '';
168
  }
169
- $string = \fread($this->stream, $length);
170
- if (\false === $string) {
 
171
  throw new \RuntimeException('Unable to read from stream');
172
  }
 
173
  return $string;
174
  }
 
175
  public function write($string)
176
  {
177
  if (!$this->writable) {
178
  throw new \RuntimeException('Cannot write to a non-writable stream');
179
  }
 
180
  // We can't know the size after writing anything
181
  $this->size = null;
182
- $result = \fwrite($this->stream, $string);
183
- if ($result === \false) {
 
184
  throw new \RuntimeException('Unable to write to stream');
185
  }
 
186
  return $result;
187
  }
 
188
  public function getMetadata($key = null)
189
  {
190
  if (!isset($this->stream)) {
191
  return $key ? null : [];
192
  } elseif (!$key) {
193
- return $this->customMetadata + \stream_get_meta_data($this->stream);
194
  } elseif (isset($this->customMetadata[$key])) {
195
  return $this->customMetadata[$key];
196
  }
197
- $meta = \stream_get_meta_data($this->stream);
 
 
198
  return isset($meta[$key]) ? $meta[$key] : null;
199
  }
200
  }
1
  <?php
2
+ namespace GuzzleHttp\Psr7;
3
 
4
+ use Psr\Http\Message\StreamInterface;
5
 
 
6
  /**
7
  * PHP stream implementation.
8
  *
9
  * @var $stream
10
  */
11
+ class Stream implements StreamInterface
12
  {
13
  private $stream;
14
  private $size;
17
  private $writable;
18
  private $uri;
19
  private $customMetadata;
20
+
21
  /** @var array Hash of readable and writable stream types */
22
+ private static $readWriteHash = [
23
+ 'read' => [
24
+ 'r' => true, 'w+' => true, 'r+' => true, 'x+' => true, 'c+' => true,
25
+ 'rb' => true, 'w+b' => true, 'r+b' => true, 'x+b' => true,
26
+ 'c+b' => true, 'rt' => true, 'w+t' => true, 'r+t' => true,
27
+ 'x+t' => true, 'c+t' => true, 'a+' => true
28
+ ],
29
+ 'write' => [
30
+ 'w' => true, 'w+' => true, 'rw' => true, 'r+' => true, 'x+' => true,
31
+ 'c+' => true, 'wb' => true, 'w+b' => true, 'r+b' => true,
32
+ 'x+b' => true, 'c+b' => true, 'w+t' => true, 'r+t' => true,
33
+ 'x+t' => true, 'c+t' => true, 'a' => true, 'a+' => true
34
+ ]
35
+ ];
36
+
37
  /**
38
  * This constructor accepts an associative array of options.
39
  *
50
  */
51
  public function __construct($stream, $options = [])
52
  {
53
+ if (!is_resource($stream)) {
54
  throw new \InvalidArgumentException('Stream must be a resource');
55
  }
56
+
57
  if (isset($options['size'])) {
58
  $this->size = $options['size'];
59
  }
60
+
61
+ $this->customMetadata = isset($options['metadata'])
62
+ ? $options['metadata']
63
+ : [];
64
+
65
  $this->stream = $stream;
66
+ $meta = stream_get_meta_data($this->stream);
67
  $this->seekable = $meta['seekable'];
68
  $this->readable = isset(self::$readWriteHash['read'][$meta['mode']]);
69
  $this->writable = isset(self::$readWriteHash['write'][$meta['mode']]);
70
  $this->uri = $this->getMetadata('uri');
71
  }
72
+
73
  public function __get($name)
74
  {
75
  if ($name == 'stream') {
76
  throw new \RuntimeException('The stream is detached');
77
  }
78
+
79
  throw new \BadMethodCallException('No value for ' . $name);
80
  }
81
+
82
  /**
83
  * Closes the stream when the destructed
84
  */
86
  {
87
  $this->close();
88
  }
89
+
90
  public function __toString()
91
  {
92
  try {
93
  $this->seek(0);
94
+ return (string) stream_get_contents($this->stream);
95
  } catch (\Exception $e) {
96
  return '';
97
  }
98
  }
99
+
100
  public function getContents()
101
  {
102
+ $contents = stream_get_contents($this->stream);
103
+
104
+ if ($contents === false) {
105
  throw new \RuntimeException('Unable to read stream contents');
106
  }
107
+
108
  return $contents;
109
  }
110
+
111
  public function close()
112
  {
113
  if (isset($this->stream)) {
114
+ if (is_resource($this->stream)) {
115
+ fclose($this->stream);
116
  }
117
  $this->detach();
118
  }
119
  }
120
+
121
  public function detach()
122
  {
123
  if (!isset($this->stream)) {
124
  return null;
125
  }
126
+
127
  $result = $this->stream;
128
  unset($this->stream);
129
  $this->size = $this->uri = null;
130
+ $this->readable = $this->writable = $this->seekable = false;
131
+
132
  return $result;
133
  }
134
+
135
  public function getSize()
136
  {
137
  if ($this->size !== null) {
138
  return $this->size;
139
  }
140
+
141
  if (!isset($this->stream)) {
142
  return null;
143
  }
144
+
145
  // Clear the stat cache if the stream has a URI
146
  if ($this->uri) {
147
+ clearstatcache(true, $this->uri);
148
  }
149
+
150
+ $stats = fstat($this->stream);
151
  if (isset($stats['size'])) {
152
  $this->size = $stats['size'];
153
  return $this->size;
154
  }
155
+
156
  return null;
157
  }
158
+
159
  public function isReadable()
160
  {
161
  return $this->readable;
162
  }
163
+
164
  public function isWritable()
165
  {
166
  return $this->writable;
167
  }
168
+
169
  public function isSeekable()
170
  {
171
  return $this->seekable;
172
  }
173
+
174
  public function eof()
175
  {
176
+ return !$this->stream || feof($this->stream);
177
  }
178
+
179
  public function tell()
180
  {
181
+ $result = ftell($this->stream);
182
+
183
+ if ($result === false) {
184
  throw new \RuntimeException('Unable to determine stream position');
185
  }
186
+
187
  return $result;
188
  }
189
+
190
  public function rewind()
191
  {
192
  $this->seek(0);
193
  }
194
+
195
+ public function seek($offset, $whence = SEEK_SET)
196
  {
197
  if (!$this->seekable) {
198
  throw new \RuntimeException('Stream is not seekable');
199
+ } elseif (fseek($this->stream, $offset, $whence) === -1) {
200
+ throw new \RuntimeException('Unable to seek to stream position '
201
+ . $offset . ' with whence ' . var_export($whence, true));
202
  }
203
  }
204
+
205
  public function read($length)
206
  {
207
  if (!$this->readable) {
210
  if ($length < 0) {
211
  throw new \RuntimeException('Length parameter cannot be negative');
212
  }
213
+
214
  if (0 === $length) {
215
  return '';
216
  }
217
+
218
+ $string = fread($this->stream, $length);
219
+ if (false === $string) {
220
  throw new \RuntimeException('Unable to read from stream');
221
  }
222
+
223
  return $string;
224
  }
225
+
226
  public function write($string)
227
  {
228
  if (!$this->writable) {
229
  throw new \RuntimeException('Cannot write to a non-writable stream');
230
  }
231
+
232
  // We can't know the size after writing anything
233
  $this->size = null;
234
+ $result = fwrite($this->stream, $string);
235
+
236
+ if ($result === false) {
237
  throw new \RuntimeException('Unable to write to stream');
238
  }
239
+
240
  return $result;
241
  }
242
+
243
  public function getMetadata($key = null)
244
  {
245
  if (!isset($this->stream)) {
246
  return $key ? null : [];
247
  } elseif (!$key) {
248
+ return $this->customMetadata + stream_get_meta_data($this->stream);
249
  } elseif (isset($this->customMetadata[$key])) {
250
  return $this->customMetadata[$key];
251
  }
252
+
253
+ $meta = stream_get_meta_data($this->stream);
254
+
255
  return isset($meta[$key]) ? $meta[$key] : null;
256
  }
257
  }
includes/mollie-api-php/vendor/guzzlehttp/psr7/src/StreamDecoratorTrait.php CHANGED
@@ -1,8 +1,8 @@
1
  <?php
 
2
 
3
- namespace _PhpScoper5b6804f9734c8\GuzzleHttp\Psr7;
4
 
5
- use _PhpScoper5b6804f9734c8\Psr\Http\Message\StreamInterface;
6
  /**
7
  * Stream decorator trait
8
  * @property StreamInterface stream
@@ -12,10 +12,11 @@ trait StreamDecoratorTrait
12
  /**
13
  * @param StreamInterface $stream Stream to decorate
14
  */
15
- public function __construct(\_PhpScoper5b6804f9734c8\Psr\Http\Message\StreamInterface $stream)
16
  {
17
  $this->stream = $stream;
18
  }
 
19
  /**
20
  * Magic method used to create a new stream if streams are not added in
21
  * the constructor of a decorator (e.g., LazyOpenStream).
@@ -30,8 +31,10 @@ trait StreamDecoratorTrait
30
  $this->stream = $this->createStream();
31
  return $this->stream;
32
  }
33
- throw new \UnexpectedValueException("{$name} not found on class");
 
34
  }
 
35
  public function __toString()
36
  {
37
  try {
@@ -41,14 +44,17 @@ trait StreamDecoratorTrait
41
  return $this->getContents();
42
  } catch (\Exception $e) {
43
  // Really, PHP? https://bugs.php.net/bug.php?id=53648
44
- \trigger_error('StreamDecorator::__toString exception: ' . (string) $e, \E_USER_ERROR);
 
45
  return '';
46
  }
47
  }
 
48
  public function getContents()
49
  {
50
  return copy_to_string($this);
51
  }
 
52
  /**
53
  * Allow decorators to implement custom methods
54
  *
@@ -59,62 +65,77 @@ trait StreamDecoratorTrait
59
  */
60
  public function __call($method, array $args)
61
  {
62
- $result = \call_user_func_array([$this->stream, $method], $args);
 
63
  // Always return the wrapped object if the result is a return $this
64
  return $result === $this->stream ? $this : $result;
65
  }
 
66
  public function close()
67
  {
68
  $this->stream->close();
69
  }
 
70
  public function getMetadata($key = null)
71
  {
72
  return $this->stream->getMetadata($key);
73
  }
 
74
  public function detach()
75
  {
76
  return $this->stream->detach();
77
  }
 
78
  public function getSize()
79
  {
80
  return $this->stream->getSize();
81
  }
 
82
  public function eof()
83
  {
84
  return $this->stream->eof();
85
  }
 
86
  public function tell()
87
  {
88
  return $this->stream->tell();
89
  }
 
90
  public function isReadable()
91
  {
92
  return $this->stream->isReadable();
93
  }
 
94
  public function isWritable()
95
  {
96
  return $this->stream->isWritable();
97
  }
 
98
  public function isSeekable()
99
  {
100
  return $this->stream->isSeekable();
101
  }
 
102
  public function rewind()
103
  {
104
  $this->seek(0);
105
  }
106
- public function seek($offset, $whence = \SEEK_SET)
 
107
  {
108
  $this->stream->seek($offset, $whence);
109
  }
 
110
  public function read($length)
111
  {
112
  return $this->stream->read($length);
113
  }
 
114
  public function write($string)
115
  {
116
  return $this->stream->write($string);
117
  }
 
118
  /**
119
  * Implement in subclasses to dynamically create streams when requested.
120
  *
1
  <?php
2
+ namespace GuzzleHttp\Psr7;
3
 
4
+ use Psr\Http\Message\StreamInterface;
5
 
 
6
  /**
7
  * Stream decorator trait
8
  * @property StreamInterface stream
12
  /**
13
  * @param StreamInterface $stream Stream to decorate
14
  */
15
+ public function __construct(StreamInterface $stream)
16
  {
17
  $this->stream = $stream;
18
  }
19
+
20
  /**
21
  * Magic method used to create a new stream if streams are not added in
22
  * the constructor of a decorator (e.g., LazyOpenStream).
31
  $this->stream = $this->createStream();
32
  return $this->stream;
33
  }
34
+
35
+ throw new \UnexpectedValueException("$name not found on class");
36
  }
37
+
38
  public function __toString()
39
  {
40
  try {
44
  return $this->getContents();
45
  } catch (\Exception $e) {
46
  // Really, PHP? https://bugs.php.net/bug.php?id=53648
47
+ trigger_error('StreamDecorator::__toString exception: '
48
+ . (string) $e, E_USER_ERROR);
49
  return '';
50
  }
51
  }
52
+
53
  public function getContents()
54
  {
55
  return copy_to_string($this);
56
  }
57
+
58
  /**
59
  * Allow decorators to implement custom methods
60
  *
65
  */
66
  public function __call($method, array $args)
67
  {
68
+ $result = call_user_func_array([$this->stream, $method], $args);
69
+
70
  // Always return the wrapped object if the result is a return $this
71
  return $result === $this->stream ? $this : $result;
72
  }
73
+
74
  public function close()
75
  {
76
  $this->stream->close();
77
  }
78
+
79
  public function getMetadata($key = null)
80
  {
81
  return $this->stream->getMetadata($key);
82
  }
83
+
84
  public function detach()
85
  {
86
  return $this->stream->detach();
87
  }
88
+
89
  public function getSize()
90
  {
91
  return $this->stream->getSize();
92
  }
93
+
94
  public function eof()
95
  {
96
  return $this->stream->eof();
97
  }
98
+
99
  public function tell()
100
  {
101
  return $this->stream->tell();
102
  }
103
+
104
  public function isReadable()
105
  {
106
  return $this->stream->isReadable();
107
  }
108
+
109
  public function isWritable()
110
  {
111
  return $this->stream->isWritable();
112
  }
113
+
114
  public function isSeekable()
115
  {
116
  return $this->stream->isSeekable();
117
  }
118
+
119
  public function rewind()
120
  {
121
  $this->seek(0);
122
  }
123
+
124
+ public function seek($offset, $whence = SEEK_SET)
125
  {
126
  $this->stream->seek($offset, $whence);
127
  }
128
+
129
  public function read($length)
130
  {
131
  return $this->stream->read($length);
132
  }
133
+
134
  public function write($string)
135
  {
136
  return $this->stream->write($string);
137
  }
138
+
139
  /**
140
  * Implement in subclasses to dynamically create streams when requested.
141
  *
includes/mollie-api-php/vendor/guzzlehttp/psr7/src/StreamWrapper.php CHANGED
@@ -1,8 +1,8 @@
1
  <?php
 
2
 
3
- namespace _PhpScoper5b6804f9734c8\GuzzleHttp\Psr7;
4
 
5
- use _PhpScoper5b6804f9734c8\Psr\Http\Message\StreamInterface;
6
  /**
7
  * Converts Guzzle streams into PHP stream resources.
8
  */
@@ -10,10 +10,13 @@ class StreamWrapper
10
  {
11
  /** @var resource */
12
  public $context;
 
13
  /** @var StreamInterface */
14
  private $stream;
 
15
  /** @var string r, r+, or w */
16
  private $mode;
 
17
  /**
18
  * Returns a resource representing the stream.
19
  *
@@ -22,61 +25,97 @@ class StreamWrapper
22
  * @return resource
23
  * @throws \InvalidArgumentException if stream is not readable or writable
24
  */
25
- public static function getResource(\_PhpScoper5b6804f9734c8\Psr\Http\Message\StreamInterface $stream)
26
  {
27
  self::register();
 
28
  if ($stream->isReadable()) {
29
  $mode = $stream->isWritable() ? 'r+' : 'r';
30
  } elseif ($stream->isWritable()) {
31
  $mode = 'w';
32
  } else {
33
- throw new \InvalidArgumentException('The stream must be readable, ' . 'writable, or both.');
 
34
  }
35
- return \fopen('guzzle://stream', $mode, null, \stream_context_create(['guzzle' => ['stream' => $stream]]));
 
 
 
36
  }
 
37
  /**
38
  * Registers the stream wrapper if needed
39
  */
40
  public static function register()
41
  {
42
- if (!\in_array('guzzle', \stream_get_wrappers())) {
43
- \stream_wrapper_register('guzzle', __CLASS__);
44
  }
45
  }
 
46
  public function stream_open($path, $mode, $options, &$opened_path)
47
  {
48
- $options = \stream_context_get_options($this->context);
 
49
  if (!isset($options['guzzle']['stream'])) {
50
- return \false;
51
  }
 
52
  $this->mode = $mode;
53
  $this->stream = $options['guzzle']['stream'];
54
- return \true;
 
55
  }
 
56
  public function stream_read($count)
57
  {
58
  return $this->stream->read($count);
59
  }
 
60
  public function stream_write($data)
61
  {
62
  return (int) $this->stream->write($data);
63
  }
 
64
  public function stream_tell()
65
  {
66
  return $this->stream->tell();
67
  }
 
68
  public function stream_eof()
69
  {
70
  return $this->stream->eof();
71
  }
 
72
  public function stream_seek($offset, $whence)
73
  {
74
  $this->stream->seek($offset, $whence);
75
- return \true;
 
76
  }
 
77
  public function stream_stat()
78
  {
79
- static $modeMap = ['r' => 33060, 'r+' => 33206, 'w' => 33188];
80
- return ['dev' => 0, 'ino' => 0, 'mode' => $modeMap[$this->mode], 'nlink' => 0, 'uid' => 0, 'gid' => 0, 'rdev' => 0, 'size' => $this->stream->getSize() ?: 0, 'atime' => 0, 'mtime' => 0, 'ctime' => 0, 'blksize' => 0, 'blocks' => 0];
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
81
  }
82
  }
1
  <?php
2
+ namespace GuzzleHttp\Psr7;
3
 
4
+ use Psr\Http\Message\StreamInterface;
5
 
 
6
  /**
7
  * Converts Guzzle streams into PHP stream resources.
8
  */
10
  {
11
  /** @var resource */
12
  public $context;
13
+
14
  /** @var StreamInterface */
15
  private $stream;
16
+
17
  /** @var string r, r+, or w */
18
  private $mode;
19
+
20
  /**
21
  * Returns a resource representing the stream.
22
  *
25
  * @return resource
26
  * @throws \InvalidArgumentException if stream is not readable or writable
27
  */
28
+ public static function getResource(StreamInterface $stream)
29
  {
30
  self::register();
31
+
32
  if ($stream->isReadable()) {
33
  $mode = $stream->isWritable() ? 'r+' : 'r';
34
  } elseif ($stream->isWritable()) {
35
  $mode = 'w';
36
  } else {
37
+ throw new \InvalidArgumentException('The stream must be readable, '
38
+ . 'writable, or both.');
39
  }
40
+
41
+ return fopen('guzzle://stream', $mode, null, stream_context_create([
42
+ 'guzzle' => ['stream' => $stream]
43
+ ]));
44
  }
45
+
46
  /**
47
  * Registers the stream wrapper if needed
48
  */
49
  public static function register()
50
  {
51
+ if (!in_array('guzzle', stream_get_wrappers())) {
52
+ stream_wrapper_register('guzzle', __CLASS__);
53
  }
54
  }
55
+
56
  public function stream_open($path, $mode, $options, &$opened_path)
57
  {
58
+ $options = stream_context_get_options($this->context);
59
+
60
  if (!isset($options['guzzle']['stream'])) {
61
+ return false;
62
  }
63
+
64
  $this->mode = $mode;
65
  $this->stream = $options['guzzle']['stream'];
66
+
67
+ return true;
68
  }
69
+
70
  public function stream_read($count)
71
  {
72
  return $this->stream->read($count);
73
  }
74
+
75
  public function stream_write($data)
76
  {
77
  return (int) $this->stream->write($data);
78
  }
79
+
80
  public function stream_tell()
81
  {
82
  return $this->stream->tell();
83
  }
84
+
85
  public function stream_eof()
86
  {
87
  return $this->stream->eof();
88
  }
89
+
90
  public function stream_seek($offset, $whence)
91
  {
92
  $this->stream->seek($offset, $whence);
93
+
94
+ return true;
95
  }
96
+
97
  public function stream_stat()
98
  {
99
+ static $modeMap = [
100
+ 'r' => 33060,
101
+ 'r+' => 33206,
102
+ 'w' => 33188
103
+ ];
104
+
105
+ return [
106
+ 'dev' => 0,
107
+ 'ino' => 0,
108
+ 'mode' => $modeMap[$this->mode],
109
+ 'nlink' => 0,
110
+ 'uid' => 0,
111
+ 'gid' => 0,
112
+ 'rdev' => 0,
113
+ 'size' => $this->stream->getSize() ?: 0,
114
+ 'atime' => 0,
115
+ 'mtime' => 0,
116
+ 'ctime' => 0,
117
+ 'blksize' => 0,
118
+ 'blocks' => 0
119
+ ];
120
  }
121
  }
includes/mollie-api-php/vendor/guzzlehttp/psr7/src/UploadedFile.php CHANGED
@@ -1,45 +1,62 @@
1
  <?php
2
-
3
- namespace _PhpScoper5b6804f9734c8\GuzzleHttp\Psr7;
4
 
5
  use InvalidArgumentException;
6
- use _PhpScoper5b6804f9734c8\Psr\Http\Message\StreamInterface;
7
- use _PhpScoper5b6804f9734c8\Psr\Http\Message\UploadedFileInterface;
8
  use RuntimeException;
9
- class UploadedFile implements \_PhpScoper5b6804f9734c8\Psr\Http\Message\UploadedFileInterface
 
10
  {
11
  /**
12
  * @var int[]
13
  */
14
- private static $errors = [\UPLOAD_ERR_OK, \UPLOAD_ERR_INI_SIZE, \UPLOAD_ERR_FORM_SIZE, \UPLOAD_ERR_PARTIAL, \UPLOAD_ERR_NO_FILE, \UPLOAD_ERR_NO_TMP_DIR, \UPLOAD_ERR_CANT_WRITE, \UPLOAD_ERR_EXTENSION];
 
 
 
 
 
 
 
 
 
 
15
  /**
16
  * @var string
17
  */
18
  private $clientFilename;
 
19
  /**
20
  * @var string
21
  */
22
  private $clientMediaType;
 
23
  /**
24
  * @var int
25
  */
26
  private $error;
 
27
  /**
28
  * @var null|string
29
  */
30
  private $file;
 
31
  /**
32
  * @var bool
33
  */
34
- private $moved = \false;
 
35
  /**
36
  * @var int
37
  */
38
  private $size;
 
39
  /**
40
  * @var StreamInterface|null
41
  */
42
  private $stream;
 
43
  /**
44
  * @param StreamInterface|string|resource $streamOrFile
45
  * @param int $size
@@ -47,16 +64,23 @@ class UploadedFile implements \_PhpScoper5b6804f9734c8\Psr\Http\Message\Uploaded
47
  * @param string|null $clientFilename
48
  * @param string|null $clientMediaType
49
  */
50
- public function __construct($streamOrFile, $size, $errorStatus, $clientFilename = null, $clientMediaType = null)
51
- {
 
 
 
 
 
52
  $this->setError($errorStatus);
53
  $this->setSize($size);
54
  $this->setClientFilename($clientFilename);
55
  $this->setClientMediaType($clientMediaType);
 
56
  if ($this->isOk()) {
57
  $this->setStreamOrFile($streamOrFile);
58
  }
59
  }
 
60
  /**
61
  * Depending on the value set file or stream variable
62
  *
@@ -65,79 +89,103 @@ class UploadedFile implements \_PhpScoper5b6804f9734c8\Psr\Http\Message\Uploaded
65
  */
66
  private function setStreamOrFile($streamOrFile)
67
  {
68
- if (\is_string($streamOrFile)) {
69
  $this->file = $streamOrFile;
70
- } elseif (\is_resource($streamOrFile)) {
71
- $this->stream = new \_PhpScoper5b6804f9734c8\GuzzleHttp\Psr7\Stream($streamOrFile);
72
- } elseif ($streamOrFile instanceof \_PhpScoper5b6804f9734c8\Psr\Http\Message\StreamInterface) {
73
  $this->stream = $streamOrFile;
74
  } else {
75
- throw new \InvalidArgumentException('Invalid stream or file provided for UploadedFile');
 
 
76
  }
77
  }
 
78
  /**
79
  * @param int $error
80
  * @throws InvalidArgumentException
81
  */
82
  private function setError($error)
83
  {
84
- if (\false === \is_int($error)) {
85
- throw new \InvalidArgumentException('Upload file error status must be an integer');
 
 
86
  }
87
- if (\false === \in_array($error, \_PhpScoper5b6804f9734c8\GuzzleHttp\Psr7\UploadedFile::$errors)) {
88
- throw new \InvalidArgumentException('Invalid error status for UploadedFile');
 
 
 
89
  }
 
90
  $this->error = $error;
91
  }
 
92
  /**
93
  * @param int $size
94
  * @throws InvalidArgumentException
95
  */
96
  private function setSize($size)
97
  {
98
- if (\false === \is_int($size)) {
99
- throw new \InvalidArgumentException('Upload file size must be an integer');
 
 
100
  }
 
101
  $this->size = $size;
102
  }
 
103
  /**
104
  * @param mixed $param
105
  * @return boolean
106
  */
107
  private function isStringOrNull($param)
108
  {
109
- return \in_array(\gettype($param), ['string', 'NULL']);
110
  }
 
111
  /**
112
  * @param mixed $param
113
  * @return boolean
114
  */
115
  private function isStringNotEmpty($param)
116
  {
117
- return \is_string($param) && \false === empty($param);
118
  }
 
119
  /**
120
  * @param string|null $clientFilename
121
  * @throws InvalidArgumentException
122
  */
123
  private function setClientFilename($clientFilename)
124
  {
125
- if (\false === $this->isStringOrNull($clientFilename)) {
126
- throw new \InvalidArgumentException('Upload file client filename must be a string or null');
 
 
127
  }
 
128
  $this->clientFilename = $clientFilename;
129
  }
 
130
  /**
131
  * @param string|null $clientMediaType
132
  * @throws InvalidArgumentException
133
  */
134
  private function setClientMediaType($clientMediaType)
135
  {
136
- if (\false === $this->isStringOrNull($clientMediaType)) {
137
- throw new \InvalidArgumentException('Upload file client media type must be a string or null');
 
 
138
  }
 
139
  $this->clientMediaType = $clientMediaType;
140
  }
 
141
  /**
142
  * Return true if there is no upload error
143
  *
@@ -145,8 +193,9 @@ class UploadedFile implements \_PhpScoper5b6804f9734c8\Psr\Http\Message\Uploaded
145
  */
146
  private function isOk()
147
  {
148
- return $this->error === \UPLOAD_ERR_OK;
149
  }
 
150
  /**
151
  * @return boolean
152
  */
@@ -154,18 +203,21 @@ class UploadedFile implements \_PhpScoper5b6804f9734c8\Psr\Http\Message\Uploaded
154
  {
155
  return $this->moved;
156
  }
 
157
  /**
158
  * @throws RuntimeException if is moved or not ok
159
  */
160
  private function validateActive()
161
  {
162
- if (\false === $this->isOk()) {
163
- throw new \RuntimeException('Cannot retrieve stream due to upload error');
164
  }
 
165
  if ($this->isMoved()) {
166
- throw new \RuntimeException('Cannot retrieve stream after it has already been moved');
167
  }
168
  }
 
169
  /**
170
  * {@inheritdoc}
171
  * @throws RuntimeException if the upload was not successful.
@@ -173,11 +225,14 @@ class UploadedFile implements \_PhpScoper5b6804f9734c8\Psr\Http\Message\Uploaded
173
  public function getStream()
174
  {
175
  $this->validateActive();
176
- if ($this->stream instanceof \_PhpScoper5b6804f9734c8\Psr\Http\Message\StreamInterface) {
 
177
  return $this->stream;
178
  }
179
- return new \_PhpScoper5b6804f9734c8\GuzzleHttp\Psr7\LazyOpenStream($this->file, 'r+');
 
180
  }
 
181
  /**
182
  * {@inheritdoc}
183
  *
@@ -192,19 +247,33 @@ class UploadedFile implements \_PhpScoper5b6804f9734c8\Psr\Http\Message\Uploaded
192
  public function moveTo($targetPath)
193
  {
194
  $this->validateActive();
195
- if (\false === $this->isStringNotEmpty($targetPath)) {
196
- throw new \InvalidArgumentException('Invalid path provided for move operation; must be a non-empty string');
 
 
 
197
  }
 
198
  if ($this->file) {
199
- $this->moved = \php_sapi_name() == 'cli' ? \rename($this->file, $targetPath) : \move_uploaded_file($this->file, $targetPath);
 
 
200
  } else {
201
- copy_to_stream($this->getStream(), new \_PhpScoper5b6804f9734c8\GuzzleHttp\Psr7\LazyOpenStream($targetPath, 'w'));
202
- $this->moved = \true;
 
 
 
 
203
  }
204
- if (\false === $this->moved) {
205
- throw new \RuntimeException(\sprintf('Uploaded file could not be moved to %s', $targetPath));
 
 
 
206
  }
207
  }
 
208
  /**
209
  * {@inheritdoc}
210
  *
@@ -214,6 +283,7 @@ class UploadedFile implements \_PhpScoper5b6804f9734c8\Psr\Http\Message\Uploaded
214
  {
215
  return $this->size;
216
  }
 
217
  /**
218
  * {@inheritdoc}
219
  *
@@ -224,6 +294,7 @@ class UploadedFile implements \_PhpScoper5b6804f9734c8\Psr\Http\Message\Uploaded
224
  {
225
  return $this->error;
226
  }
 
227
  /**
228
  * {@inheritdoc}
229
  *
@@ -234,6 +305,7 @@ class UploadedFile implements \_PhpScoper5b6804f9734c8\Psr\Http\Message\Uploaded
234
  {
235
  return $this->clientFilename;
236
  }
 
237
  /**
238
  * {@inheritdoc}
239
  */
1
  <?php
2
+ namespace GuzzleHttp\Psr7;
 
3
 
4
  use InvalidArgumentException;
5
+ use Psr\Http\Message\StreamInterface;
6
+ use Psr\Http\Message\UploadedFileInterface;
7
  use RuntimeException;
8
+
9
+ class UploadedFile implements UploadedFileInterface
10
  {
11
  /**
12
  * @var int[]
13
  */
14
+ private static $errors = [
15
+ UPLOAD_ERR_OK,
16
+ UPLOAD_ERR_INI_SIZE,
17
+ UPLOAD_ERR_FORM_SIZE,
18
+ UPLOAD_ERR_PARTIAL,
19
+ UPLOAD_ERR_NO_FILE,
20
+ UPLOAD_ERR_NO_TMP_DIR,
21
+ UPLOAD_ERR_CANT_WRITE,
22
+ UPLOAD_ERR_EXTENSION,
23
+ ];
24
+
25
  /**
26
  * @var string
27
  */
28
  private $clientFilename;
29
+
30
  /**
31
  * @var string
32
  */
33
  private $clientMediaType;
34
+
35
  /**
36
  * @var int
37
  */
38
  private $error;
39
+
40
  /**
41
  * @var null|string
42
  */
43
  private $file;
44
+
45
  /**
46
  * @var bool
47
  */
48
+ private $moved = false;
49
+
50
  /**
51
  * @var int
52
  */
53
  private $size;
54
+
55
  /**
56
  * @var StreamInterface|null
57
  */
58
  private $stream;
59
+
60
  /**
61
  * @param StreamInterface|string|resource $streamOrFile
62
  * @param int $size
64
  * @param string|null $clientFilename
65
  * @param string|null $clientMediaType
66
  */
67
+ public function __construct(
68
+ $streamOrFile,
69
+ $size,
70
+ $errorStatus,
71
+ $clientFilename = null,
72
+ $clientMediaType = null
73
+ ) {
74
  $this->setError($errorStatus);
75
  $this->setSize($size);
76
  $this->setClientFilename($clientFilename);
77
  $this->setClientMediaType($clientMediaType);
78
+
79
  if ($this->isOk()) {
80
  $this->setStreamOrFile($streamOrFile);
81
  }
82
  }
83
+
84
  /**
85
  * Depending on the value set file or stream variable
86
  *
89
  */
90
  private function setStreamOrFile($streamOrFile)
91
  {
92
+ if (is_string($streamOrFile)) {
93
  $this->file = $streamOrFile;
94
+ } elseif (is_resource($streamOrFile)) {
95
+ $this->stream = new Stream($streamOrFile);
96
+ } elseif ($streamOrFile instanceof StreamInterface) {
97
  $this->stream = $streamOrFile;
98
  } else {
99
+ throw new InvalidArgumentException(
100
+ 'Invalid stream or file provided for UploadedFile'
101
+ );
102
  }
103
  }
104
+
105
  /**
106
  * @param int $error
107
  * @throws InvalidArgumentException
108
  */
109
  private function setError($error)
110
  {
111
+ if (false === is_int($error)) {
112
+ throw new InvalidArgumentException(
113
+ 'Upload file error status must be an integer'
114
+ );
115
  }
116
+
117
+ if (false === in_array($error, UploadedFile::$errors)) {
118
+ throw new InvalidArgumentException(
119
+ 'Invalid error status for UploadedFile'
120
+ );
121
  }
122
+
123
  $this->error = $error;
124
  }
125
+
126
  /**
127
  * @param int $size
128
  * @throws InvalidArgumentException
129
  */
130
  private function setSize($size)
131
  {
132
+ if (false === is_int($size)) {
133
+ throw new InvalidArgumentException(
134
+ 'Upload file size must be an integer'
135
+ );
136
  }
137
+
138
  $this->size = $size;
139
  }
140
+
141
  /**
142
  * @param mixed $param
143
  * @return boolean
144
  */
145
  private function isStringOrNull($param)
146
  {
147
+ return in_array(gettype($param), ['string', 'NULL']);
148
  }
149
+
150
  /**
151
  * @param mixed $param
152
  * @return boolean
153
  */
154
  private function isStringNotEmpty($param)
155
  {
156
+ return is_string($param) && false === empty($param);
157
  }
158
+
159
  /**
160
  * @param string|null $clientFilename
161
  * @throws InvalidArgumentException
162
  */
163
  private function setClientFilename($clientFilename)
164
  {
165
+ if (false === $this->isStringOrNull($clientFilename)) {
166
+ throw new InvalidArgumentException(
167
+ 'Upload file client filename must be a string or null'
168
+ );
169
  }
170
+
171
  $this->clientFilename = $clientFilename;
172
  }
173
+
174
  /**
175
  * @param string|null $clientMediaType
176
  * @throws InvalidArgumentException
177
  */
178
  private function setClientMediaType($clientMediaType)
179
  {
180
+ if (false === $this->isStringOrNull($clientMediaType)) {
181
+ throw new InvalidArgumentException(
182
+ 'Upload file client media type must be a string or null'
183
+ );
184
  }
185
+
186
  $this->clientMediaType = $clientMediaType;
187
  }
188
+
189
  /**
190
  * Return true if there is no upload error
191
  *
193
  */
194
  private function isOk()
195
  {
196
+ return $this->error === UPLOAD_ERR_OK;
197
  }
198
+
199
  /**
200
  * @return boolean
201
  */
203
  {
204
  return $this->moved;
205
  }
206
+
207
  /**
208
  * @throws RuntimeException if is moved or not ok
209
  */
210
  private function validateActive()
211
  {
212
+ if (false === $this->isOk()) {
213
+ throw new RuntimeException('Cannot retrieve stream due to upload error');
214
  }
215
+
216
  if ($this->isMoved()) {
217
+ throw new RuntimeException('Cannot retrieve stream after it has already been moved');
218
  }
219
  }
220
+
221
  /**
222
  * {@inheritdoc}
223
  * @throws RuntimeException if the upload was not successful.
225
  public function getStream()
226
  {
227
  $this->validateActive();
228
+
229
+ if ($this->stream instanceof StreamInterface) {
230
  return $this->stream;
231
  }
232
+
233
+ return new LazyOpenStream($this->file, 'r+');
234
  }
235
+
236
  /**
237
  * {@inheritdoc}
238
  *
247
  public function moveTo($targetPath)
248
  {
249
  $this->validateActive();
250
+
251
+ if (false === $this->isStringNotEmpty($targetPath)) {
252
+ throw new InvalidArgumentException(
253
+ 'Invalid path provided for move operation; must be a non-empty string'
254
+ );
255
  }
256
+
257
  if ($this->file) {
258
+ $this->moved = php_sapi_name() == 'cli'
259
+ ? rename($this->file, $targetPath)
260
+ : move_uploaded_file($this->file, $targetPath);
261
  } else {
262
+ copy_to_stream(
263
+ $this->getStream(),
264
+ new LazyOpenStream($targetPath, 'w')
265
+ );
266
+
267
+ $this->moved = true;
268
  }
269
+
270
+ if (false === $this->moved) {
271
+ throw new RuntimeException(
272
+ sprintf('Uploaded file could not be moved to %s', $targetPath)
273
+ );
274
  }
275
  }
276
+
277
  /**
278
  * {@inheritdoc}
279
  *
283
  {
284
  return $this->size;
285
  }
286
+
287
  /**
288
  * {@inheritdoc}
289
  *
294
  {
295
  return $this->error;
296
  }
297
+
298
  /**
299
  * {@inheritdoc}
300
  *
305
  {
306
  return $this->clientFilename;
307
  }
308
+
309
  /**
310
  * {@inheritdoc}
311
  */
includes/mollie-api-php/vendor/guzzlehttp/psr7/src/Uri.php CHANGED
@@ -1,8 +1,8 @@
1
  <?php
 
2
 
3
- namespace _PhpScoper5b6804f9734c8\GuzzleHttp\Psr7;
4
 
5
- use _PhpScoper5b6804f9734c8\Psr\Http\Message\UriInterface;
6
  /**
7
  * PSR-7 URI implementation.
8
  *
@@ -10,7 +10,7 @@ use _PhpScoper5b6804f9734c8\Psr\Http\Message\UriInterface;
10
  * @author Tobias Schultze
11
  * @author Matthew Weier O'Phinney
12
  */
13
- class Uri implements \_PhpScoper5b6804f9734c8\Psr\Http\Message\UriInterface
14
  {
15
  /**
16
  * Absolute http and https URIs require a host per RFC 7230 Section 2.7
@@ -19,24 +19,46 @@ class Uri implements \_PhpScoper5b6804f9734c8\Psr\Http\Message\UriInterface
19
  * valid URI.
20
  */
21
  const HTTP_DEFAULT_HOST = 'localhost';
22
- private static $defaultPorts = ['http' => 80, 'https' => 443, 'ftp' => 21, 'gopher' => 70, 'nntp' => 119, 'news' => 119, 'telnet' => 23, 'tn3270' => 23, 'imap' => 143, 'pop' => 110, 'ldap' => 389];
23
- private static $charUnreserved = 'a-zA-Z0-9_\\-\\.~';
24
- private static $charSubDelims = '!\\$&\'\\(\\)\\*\\+,;=';
 
 
 
 
 
 
 
 
 
 
 
 
 
 
25
  private static $replaceQuery = ['=' => '%3D', '&' => '%26'];
 
26
  /** @var string Uri scheme. */
27
  private $scheme = '';
 
28
  /** @var string Uri user info. */
29
  private $userInfo = '';
 
30
  /** @var string Uri host. */
31
  private $host = '';
 
32
  /** @var int|null Uri port. */
33
  private $port;
 
34
  /** @var string Uri path. */
35
  private $path = '';
 
36
  /** @var string Uri query string. */
37
  private $query = '';
 
38
  /** @var string Uri fragment. */
39
  private $fragment = '';
 
40
  /**
41
  * @param string $uri URI to parse
42
  */
@@ -44,17 +66,25 @@ class Uri implements \_PhpScoper5b6804f9734c8\Psr\Http\Message\UriInterface
44
  {
45
  // weak type check to also accept null until we can add scalar type hints
46
  if ($uri != '') {
47
- $parts = \parse_url($uri);
48
- if ($parts === \false) {
49
- throw new \InvalidArgumentException("Unable to parse URI: {$uri}");
50
  }
51
  $this->applyParts($parts);
52
  }
53
  }
 
54
  public function __toString()
55
  {
56
- return self::composeComponents($this->scheme, $this->getAuthority(), $this->path, $this->query, $this->fragment);
 
 
 
 
 
 
57
  }
 
58
  /**
59
  * Composes a URI reference string from its various components.
60
  *
@@ -84,22 +114,29 @@ class Uri implements \_PhpScoper5b6804f9734c8\Psr\Http\Message\UriInterface
84
  public static function composeComponents($scheme, $authority, $path, $query, $fragment)
85
  {
86
  $uri = '';
 
87
  // weak type checks to also accept null until we can add scalar type hints
88
  if ($scheme != '') {
89
  $uri .= $scheme . ':';
90
  }
91
- if ($authority != '' || $scheme === 'file') {
 
92
  $uri .= '//' . $authority;
93
  }
 
94
  $uri .= $path;
 
95
  if ($query != '') {
96
  $uri .= '?' . $query;
97
  }
 
98
  if ($fragment != '') {
99
  $uri .= '#' . $fragment;
100
  }
 
101
  return $uri;
102
  }
 
103
  /**
104
  * Whether the URI has the default port of the current scheme.
105
  *
@@ -110,10 +147,12 @@ class Uri implements \_PhpScoper5b6804f9734c8\Psr\Http\Message\UriInterface
110
  *
111
  * @return bool
112
  */
113
- public static function isDefaultPort(\_PhpScoper5b6804f9734c8\Psr\Http\Message\UriInterface $uri)
114
  {
115
- return $uri->getPort() === null || isset(self::$defaultPorts[$uri->getScheme()]) && $uri->getPort() === self::$defaultPorts[$uri->getScheme()];
 
116
  }
 
117
  /**
118
  * Whether the URI is absolute, i.e. it has a scheme.
119
  *
@@ -132,10 +171,11 @@ class Uri implements \_PhpScoper5b6804f9734c8\Psr\Http\Message\UriInterface
132
  * @see Uri::isRelativePathReference
133
  * @link https://tools.ietf.org/html/rfc3986#section-4
134
  */
135
- public static function isAbsolute(\_PhpScoper5b6804f9734c8\Psr\Http\Message\UriInterface $uri)
136
  {
137
  return $uri->getScheme() !== '';
138
  }
 
139
  /**
140
  * Whether the URI is a network-path reference.
141
  *
@@ -146,10 +186,11 @@ class Uri implements \_PhpScoper5b6804f9734c8\Psr\Http\Message\UriInterface
146
  * @return bool
147
  * @link https://tools.ietf.org/html/rfc3986#section-4.2
148
  */
149
- public static function isNetworkPathReference(\_PhpScoper5b6804f9734c8\Psr\Http\Message\UriInterface $uri)
150
  {
151
  return $uri->getScheme() === '' && $uri->getAuthority() !== '';
152
  }
 
153
  /**
154
  * Whether the URI is a absolute-path reference.
155
  *
@@ -160,10 +201,14 @@ class Uri implements \_PhpScoper5b6804f9734c8\Psr\Http\Message\UriInterface
160
  * @return bool
161
  * @link https://tools.ietf.org/html/rfc3986#section-4.2
162
  */
163
- public static function isAbsolutePathReference(\_PhpScoper5b6804f9734c8\Psr\Http\Message\UriInterface $uri)
164
  {
165
- return $uri->getScheme() === '' && $uri->getAuthority() === '' && isset($uri->getPath()[0]) && $uri->getPath()[0] === '/';
 
 
 
166
  }
 
167
  /**
168
  * Whether the URI is a relative-path reference.
169
  *
@@ -174,10 +219,13 @@ class Uri implements \_PhpScoper5b6804f9734c8\Psr\Http\Message\UriInterface
174
  * @return bool
175
  * @link https://tools.ietf.org/html/rfc3986#section-4.2
176
  */
177
- public static function isRelativePathReference(\_PhpScoper5b6804f9734c8\Psr\Http\Message\UriInterface $uri)
178
  {
179
- return $uri->getScheme() === '' && $uri->getAuthority() === '' && (!isset($uri->getPath()[0]) || $uri->getPath()[0] !== '/');
 
 
180
  }
 
181
  /**
182
  * Whether the URI is a same-document reference.
183
  *
@@ -191,14 +239,20 @@ class Uri implements \_PhpScoper5b6804f9734c8\Psr\Http\Message\UriInterface
191
  * @return bool
192
  * @link https://tools.ietf.org/html/rfc3986#section-4.4
193
  */
194
- public static function isSameDocumentReference(\_PhpScoper5b6804f9734c8\Psr\Http\Message\UriInterface $uri, \_PhpScoper5b6804f9734c8\Psr\Http\Message\UriInterface $base = null)
195
  {
196
  if ($base !== null) {
197
- $uri = \_PhpScoper5b6804f9734c8\GuzzleHttp\Psr7\UriResolver::resolve($base, $uri);
198
- return $uri->getScheme() === $base->getScheme() && $uri->getAuthority() === $base->getAuthority() && $uri->getPath() === $base->getPath() && $uri->getQuery() === $base->getQuery();
 
 
 
 
199
  }
 
200
  return $uri->getScheme() === '' && $uri->getAuthority() === '' && $uri->getPath() === '' && $uri->getQuery() === '';
201
  }
 
202
  /**
203
  * Removes dot segments from a path and returns the new path.
204
  *
@@ -211,8 +265,9 @@ class Uri implements \_PhpScoper5b6804f9734c8\Psr\Http\Message\UriInterface
211
  */
212
  public static function removeDotSegments($path)
213
  {
214
- return \_PhpScoper5b6804f9734c8\GuzzleHttp\Psr7\UriResolver::removeDotSegments($path);
215
  }
 
216
  /**
217
  * Converts the relative URI into a new URI that is resolved against the base URI.
218
  *
@@ -224,13 +279,15 @@ class Uri implements \_PhpScoper5b6804f9734c8\Psr\Http\Message\UriInterface
224
  * @deprecated since version 1.4. Use UriResolver::resolve instead.
225
  * @see UriResolver::resolve
226
  */
227
- public static function resolve(\_PhpScoper5b6804f9734c8\Psr\Http\Message\UriInterface $base, $rel)
228
  {
229
- if (!$rel instanceof \_PhpScoper5b6804f9734c8\Psr\Http\Message\UriInterface) {
230
  $rel = new self($rel);
231
  }
232
- return \_PhpScoper5b6804f9734c8\GuzzleHttp\Psr7\UriResolver::resolve($base, $rel);
 
233
  }
 
234
  /**
235
  * Creates a new URI with a specific query string value removed.
236
  *
@@ -242,18 +299,21 @@ class Uri implements \_PhpScoper5b6804f9734c8\Psr\Http\Message\UriInterface
242
  *
243
  * @return UriInterface
244
  */
245
- public static function withoutQueryValue(\_PhpScoper5b6804f9734c8\Psr\Http\Message\UriInterface $uri, $key)
246
  {
247
  $current = $uri->getQuery();
248
  if ($current === '') {
249
  return $uri;
250
  }
251
- $decodedKey = \rawurldecode($key);
252
- $result = \array_filter(\explode('&', $current), function ($part) use($decodedKey) {
253
- return \rawurldecode(\explode('=', $part)[0]) !== $decodedKey;
 
254
  });
255
- return $uri->withQuery(\implode('&', $result));
 
256
  }
 
257
  /**
258
  * Creates a new URI with a specific query string value.
259
  *
@@ -269,28 +329,33 @@ class Uri implements \_PhpScoper5b6804f9734c8\Psr\Http\Message\UriInterface
269
  *
270
  * @return UriInterface
271
  */
272
- public static function withQueryValue(\_PhpScoper5b6804f9734c8\Psr\Http\Message\UriInterface $uri, $key, $value)
273
  {
274
  $current = $uri->getQuery();
 
275
  if ($current === '') {
276
  $result = [];
277
  } else {
278
- $decodedKey = \rawurldecode($key);
279
- $result = \array_filter(\explode('&', $current), function ($part) use($decodedKey) {
280
- return \rawurldecode(\explode('=', $part)[0]) !== $decodedKey;
281
  });
282
  }
 
283
  // Query string separators ("=", "&") within the key or value need to be encoded
284
  // (while preventing double-encoding) before setting the query string. All other
285
  // chars that need percent-encoding will be encoded by withQuery().
286
- $key = \strtr($key, self::$replaceQuery);
 
287
  if ($value !== null) {
288
- $result[] = $key . '=' . \strtr($value, self::$replaceQuery);
289
  } else {
290
  $result[] = $key;
291
  }
292
- return $uri->withQuery(\implode('&', $result));
 
293
  }
 
294
  /**
295
  * Creates a URI from a hash of `parse_url` components.
296
  *
@@ -306,127 +371,167 @@ class Uri implements \_PhpScoper5b6804f9734c8\Psr\Http\Message\UriInterface
306
  $uri = new self();
307
  $uri->applyParts($parts);
308
  $uri->validateState();
 
309
  return $uri;
310
  }
 
311
  public function getScheme()
312
  {
313
  return $this->scheme;
314
  }
 
315
  public function getAuthority()
316
  {
317
  $authority = $this->host;
318
  if ($this->userInfo !== '') {
319
  $authority = $this->userInfo . '@' . $authority;
320
  }
 
321
  if ($this->port !== null) {
322
  $authority .= ':' . $this->port;
323
  }
 
324
  return $authority;
325
  }
 
326
  public function getUserInfo()
327
  {
328
  return $this->userInfo;
329
  }
 
330
  public function getHost()
331
  {
332
  return $this->host;
333
  }
 
334
  public function getPort()
335
  {
336
  return $this->port;
337
  }
 
338
  public function getPath()
339
  {
340
  return $this->path;
341
  }
 
342
  public function getQuery()
343
  {
344
  return $this->query;
345
  }
 
346
  public function getFragment()
347
  {
348
  return $this->fragment;
349
  }
 
350
  public function withScheme($scheme)
351
  {
352
  $scheme = $this->filterScheme($scheme);
 
353
  if ($this->scheme === $scheme) {
354
  return $this;
355
  }
 
356
  $new = clone $this;
357
  $new->scheme = $scheme;
358
  $new->removeDefaultPort();
359
  $new->validateState();
 
360
  return $new;
361
  }
 
362
  public function withUserInfo($user, $password = null)
363
  {
364
  $info = $user;
365
  if ($password != '') {
366
  $info .= ':' . $password;
367
  }
 
368
  if ($this->userInfo === $info) {
369
  return $this;
370
  }
 
371
  $new = clone $this;
372
  $new->userInfo = $info;
373
  $new->validateState();
 
374
  return $new;
375
  }
 
376
  public function withHost($host)
377
  {
378
  $host = $this->filterHost($host);
 
379
  if ($this->host === $host) {
380
  return $this;
381
  }
 
382
  $new = clone $this;
383
  $new->host = $host;
384
  $new->validateState();
 
385
  return $new;
386
  }
 
387
  public function withPort($port)
388
  {
389
  $port = $this->filterPort($port);
 
390
  if ($this->port === $port) {
391
  return $this;
392
  }
 
393
  $new = clone $this;
394
  $new->port = $port;
395
  $new->removeDefaultPort();
396
  $new->validateState();
 
397
  return $new;
398
  }
 
399
  public function withPath($path)
400
  {
401
  $path = $this->filterPath($path);
 
402
  if ($this->path === $path) {
403
  return $this;
404
  }
 
405
  $new = clone $this;
406
  $new->path = $path;
407
  $new->validateState();
 
408
  return $new;
409
  }
 
410
  public function withQuery($query)
411
  {
412
  $query = $this->filterQueryAndFragment($query);
 
413
  if ($this->query === $query) {
414
  return $this;
415
  }
 
416
  $new = clone $this;
417
  $new->query = $query;
 
418
  return $new;
419
  }
 
420
  public function withFragment($fragment)
421
  {
422
  $fragment = $this->filterQueryAndFragment($fragment);
 
423
  if ($this->fragment === $fragment) {
424
  return $this;
425
  }
 
426
  $new = clone $this;
427
  $new->fragment = $fragment;
 
428
  return $new;
429
  }
 
430
  /**
431
  * Apply parse_url parts to a URI.
432
  *
@@ -434,18 +539,32 @@ class Uri implements \_PhpScoper5b6804f9734c8\Psr\Http\Message\UriInterface
434
  */
435
  private function applyParts(array $parts)
436
  {
437
- $this->scheme = isset($parts['scheme']) ? $this->filterScheme($parts['scheme']) : '';
 
 
438
  $this->userInfo = isset($parts['user']) ? $parts['user'] : '';
439
- $this->host = isset($parts['host']) ? $this->filterHost($parts['host']) : '';
440
- $this->port = isset($parts['port']) ? $this->filterPort($parts['port']) : null;
441
- $this->path = isset($parts['path']) ? $this->filterPath($parts['path']) : '';
442
- $this->query = isset($parts['query']) ? $this->filterQueryAndFragment($parts['query']) : '';
443
- $this->fragment = isset($parts['fragment']) ? $this->filterQueryAndFragment($parts['fragment']) : '';
 
 
 
 
 
 
 
 
 
 
444
  if (isset($parts['pass'])) {
445
  $this->userInfo .= ':' . $parts['pass'];
446
  }
 
447
  $this->removeDefaultPort();
448
  }
 
449
  /**
450
  * @param string $scheme
451
  *
@@ -455,11 +574,13 @@ class Uri implements \_PhpScoper5b6804f9734c8\Psr\Http\Message\UriInterface
455
  */
456
  private function filterScheme($scheme)
457
  {
458
- if (!\is_string($scheme)) {
459
  throw new \InvalidArgumentException('Scheme must be a string');
460
  }
461
- return \strtolower($scheme);
 
462
  }
 
463
  /**
464
  * @param string $host
465
  *
@@ -469,11 +590,13 @@ class Uri implements \_PhpScoper5b6804f9734c8\Psr\Http\Message\UriInterface
469
  */
470
  private function filterHost($host)
471
  {
472
- if (!\is_string($host)) {
473
  throw new \InvalidArgumentException('Host must be a string');
474
  }
475
- return \strtolower($host);
 
476
  }
 
477
  /**
478
  * @param int|null $port
479
  *
@@ -486,18 +609,24 @@ class Uri implements \_PhpScoper5b6804f9734c8\Psr\Http\Message\UriInterface
486
  if ($port === null) {
487
  return null;
488
  }
 
489
  $port = (int) $port;
490
  if (1 > $port || 0xffff < $port) {
491
- throw new \InvalidArgumentException(\sprintf('Invalid port: %d. Must be between 1 and 65535', $port));
 
 
492
  }
 
493
  return $port;
494
  }
 
495
  private function removeDefaultPort()
496
  {
497
  if ($this->port !== null && self::isDefaultPort($this)) {
498
  $this->port = null;
499
  }
500
  }
 
501
  /**
502
  * Filters the path of a URI
503
  *
@@ -509,11 +638,17 @@ class Uri implements \_PhpScoper5b6804f9734c8\Psr\Http\Message\UriInterface
509
  */
510
  private function filterPath($path)
511
  {
512
- if (!\is_string($path)) {
513
  throw new \InvalidArgumentException('Path must be a string');
514
  }
515
- return \preg_replace_callback('/(?:[^' . self::$charUnreserved . self::$charSubDelims . '%:@\\/]++|%(?![A-Fa-f0-9]{2}))/', [$this, 'rawurlencodeMatchZero'], $path);
 
 
 
 
 
516
  }
 
517
  /**
518
  * Filters the query string or fragment of a URI.
519
  *
@@ -525,30 +660,42 @@ class Uri implements \_PhpScoper5b6804f9734c8\Psr\Http\Message\UriInterface
525
  */
526
  private function filterQueryAndFragment($str)
527
  {
528
- if (!\is_string($str)) {
529
  throw new \InvalidArgumentException('Query and fragment must be a string');
530
  }
531
- return \preg_replace_callback('/(?:[^' . self::$charUnreserved . self::$charSubDelims . '%:@\\/\\?]++|%(?![A-Fa-f0-9]{2}))/', [$this, 'rawurlencodeMatchZero'], $str);
 
 
 
 
 
532
  }
 
533
  private function rawurlencodeMatchZero(array $match)
534
  {
535
- return \rawurlencode($match[0]);
536
  }
 
537
  private function validateState()
538
  {
539
  if ($this->host === '' && ($this->scheme === 'http' || $this->scheme === 'https')) {
540
  $this->host = self::HTTP_DEFAULT_HOST;
541
  }
 
542
  if ($this->getAuthority() === '') {
543
- if (0 === \strpos($this->path, '//')) {
544
  throw new \InvalidArgumentException('The path of a URI without an authority must not start with two slashes "//"');
545
  }
546
- if ($this->scheme === '' && \false !== \strpos(\explode('/', $this->path, 2)[0], ':')) {
547
  throw new \InvalidArgumentException('A relative URI must not have a path beginning with a segment containing a colon');
548
  }
549
  } elseif (isset($this->path[0]) && $this->path[0] !== '/') {
550
- @\trigger_error('The path of a URI with an authority must start with a slash "/" or be empty. Automagically fixing the URI ' . 'by adding a leading slash to the path is deprecated since version 1.4 and will throw an exception instead.', \E_USER_DEPRECATED);
551
- $this->path = '/' . $this->path;
 
 
 
 
552
  //throw new \InvalidArgumentException('The path of a URI with an authority must start with a slash "/" or be empty');
553
  }
554
  }
1
  <?php
2
+ namespace GuzzleHttp\Psr7;
3
 
4
+ use Psr\Http\Message\UriInterface;
5
 
 
6
  /**
7
  * PSR-7 URI implementation.
8
  *
10
  * @author Tobias Schultze
11
  * @author Matthew Weier O'Phinney
12
  */
13
+ class Uri implements UriInterface
14
  {
15
  /**
16
  * Absolute http and https URIs require a host per RFC 7230 Section 2.7
19
  * valid URI.
20
  */
21
  const HTTP_DEFAULT_HOST = 'localhost';
22
+
23
+ private static $defaultPorts = [
24
+ 'http' => 80,
25
+ 'https' => 443,
26
+ 'ftp' => 21,
27
+ 'gopher' => 70,
28
+ 'nntp' => 119,
29
+ 'news' => 119,
30
+ 'telnet' => 23,
31
+ 'tn3270' => 23,
32
+ 'imap' => 143,
33
+ 'pop' => 110,
34
+ 'ldap' => 389,
35
+ ];
36
+
37
+ private static $charUnreserved = 'a-zA-Z0-9_\-\.~';
38
+ private static $charSubDelims = '!\$&\'\(\)\*\+,;=';
39
  private static $replaceQuery = ['=' => '%3D', '&' => '%26'];
40
+
41
  /** @var string Uri scheme. */
42
  private $scheme = '';
43
+
44
  /** @var string Uri user info. */
45
  private $userInfo = '';
46
+
47
  /** @var string Uri host. */
48
  private $host = '';
49
+
50
  /** @var int|null Uri port. */
51
  private $port;
52
+
53
  /** @var string Uri path. */
54
  private $path = '';
55
+
56
  /** @var string Uri query string. */
57
  private $query = '';
58
+
59
  /** @var string Uri fragment. */
60
  private $fragment = '';
61
+
62
  /**
63
  * @param string $uri URI to parse
64
  */
66
  {
67
  // weak type check to also accept null until we can add scalar type hints
68
  if ($uri != '') {
69
+ $parts = parse_url($uri);
70
+ if ($parts === false) {
71
+ throw new \InvalidArgumentException("Unable to parse URI: $uri");
72
  }
73
  $this->applyParts($parts);
74
  }
75
  }
76
+
77
  public function __toString()
78
  {
79
+ return self::composeComponents(
80
+ $this->scheme,
81
+ $this->getAuthority(),
82
+ $this->path,
83
+ $this->query,
84
+ $this->fragment
85
+ );
86
  }
87
+
88
  /**
89
  * Composes a URI reference string from its various components.
90
  *
114
  public static function composeComponents($scheme, $authority, $path, $query, $fragment)
115
  {
116
  $uri = '';
117
+
118
  // weak type checks to also accept null until we can add scalar type hints
119
  if ($scheme != '') {
120
  $uri .= $scheme . ':';
121
  }
122
+
123
+ if ($authority != ''|| $scheme === 'file') {
124
  $uri .= '//' . $authority;
125
  }
126
+
127
  $uri .= $path;
128
+
129
  if ($query != '') {
130
  $uri .= '?' . $query;
131
  }
132
+
133
  if ($fragment != '') {
134
  $uri .= '#' . $fragment;
135
  }
136
+
137
  return $uri;
138
  }
139
+
140
  /**
141
  * Whether the URI has the default port of the current scheme.
142
  *
147
  *
148
  * @return bool
149
  */
150
+ public static function isDefaultPort(UriInterface $uri)
151
  {
152
+ return $uri->getPort() === null
153
+ || (isset(self::$defaultPorts[$uri->getScheme()]) && $uri->getPort() === self::$defaultPorts[$uri->getScheme()]);
154
  }
155
+
156
  /**
157
  * Whether the URI is absolute, i.e. it has a scheme.
158
  *
171
  * @see Uri::isRelativePathReference
172
  * @link https://tools.ietf.org/html/rfc3986#section-4
173
  */
174
+ public static function isAbsolute(UriInterface $uri)
175
  {
176
  return $uri->getScheme() !== '';
177
  }
178
+
179
  /**
180
  * Whether the URI is a network-path reference.
181
  *
186
  * @return bool
187
  * @link https://tools.ietf.org/html/rfc3986#section-4.2
188
  */
189
+ public static function isNetworkPathReference(UriInterface $uri)
190
  {
191
  return $uri->getScheme() === '' && $uri->getAuthority() !== '';
192
  }
193
+
194
  /**
195
  * Whether the URI is a absolute-path reference.
196
  *
201
  * @return bool
202
  * @link https://tools.ietf.org/html/rfc3986#section-4.2
203
  */
204
+ public static function isAbsolutePathReference(UriInterface $uri)
205
  {
206
+ return $uri->getScheme() === ''
207
+ && $uri->getAuthority() === ''
208
+ && isset($uri->getPath()[0])
209
+ && $uri->getPath()[0] === '/';
210
  }
211
+
212
  /**
213
  * Whether the URI is a relative-path reference.
214
  *
219
  * @return bool
220
  * @link https://tools.ietf.org/html/rfc3986#section-4.2
221
  */
222
+ public static function isRelativePathReference(UriInterface $uri)
223
  {
224
+ return $uri->getScheme() === ''
225
+ && $uri->getAuthority() === ''
226
+ && (!isset($uri->getPath()[0]) || $uri->getPath()[0] !== '/');
227
  }
228
+
229
  /**
230
  * Whether the URI is a same-document reference.
231
  *
239
  * @return bool
240
  * @link https://tools.ietf.org/html/rfc3986#section-4.4
241
  */
242
+ public static function isSameDocumentReference(UriInterface $uri, UriInterface $base = null)
243
  {
244
  if ($base !== null) {
245
+ $uri = UriResolver::resolve($base, $uri);
246
+
247
+ return ($uri->getScheme() === $base->getScheme())
248
+ && ($uri->getAuthority() === $base->getAuthority())
249
+ && ($uri->getPath() === $base->getPath())
250
+ && ($uri->getQuery() === $base->getQuery());
251
  }
252
+
253
  return $uri->getScheme() === '' && $uri->getAuthority() === '' && $uri->getPath() === '' && $uri->getQuery() === '';
254
  }
255
+
256
  /**
257
  * Removes dot segments from a path and returns the new path.
258
  *
265
  */
266
  public static function removeDotSegments($path)
267
  {
268
+ return UriResolver::removeDotSegments($path);
269
  }
270
+
271
  /**
272
  * Converts the relative URI into a new URI that is resolved against the base URI.
273
  *
279
  * @deprecated since version 1.4. Use UriResolver::resolve instead.
280
  * @see UriResolver::resolve
281
  */
282
+ public static function resolve(UriInterface $base, $rel)
283
  {
284
+ if (!($rel instanceof UriInterface)) {
285
  $rel = new self($rel);
286
  }
287
+
288
+ return UriResolver::resolve($base, $rel);
289
  }
290
+
291
  /**
292
  * Creates a new URI with a specific query string value removed.
293
  *
299
  *
300
  * @return UriInterface
301
  */
302
+ public static function withoutQueryValue(UriInterface $uri, $key)
303
  {
304
  $current = $uri->getQuery();
305
  if ($current === '') {
306
  return $uri;
307
  }
308
+
309
+ $decodedKey = rawurldecode($key);
310
+ $result = array_filter(explode('&', $current), function ($part) use ($decodedKey) {
311
+ return rawurldecode(explode('=', $part)[0]) !== $decodedKey;
312
  });
313
+
314
+ return $uri->withQuery(implode('&', $result));
315
  }
316
+
317
  /**
318
  * Creates a new URI with a specific query string value.
319
  *
329
  *
330
  * @return UriInterface
331
  */
332
+ public static function withQueryValue(UriInterface $uri, $key, $value)
333
  {
334
  $current = $uri->getQuery();
335
+
336
  if ($current === '') {
337
  $result = [];
338
  } else {
339
+ $decodedKey = rawurldecode($key);
340
+ $result = array_filter(explode('&', $current), function ($part) use ($decodedKey) {
341
+ return rawurldecode(explode('=', $part)[0]) !== $decodedKey;
342
  });
343
  }
344
+
345
  // Query string separators ("=", "&") within the key or value need to be encoded
346
  // (while preventing double-encoding) before setting the query string. All other
347
  // chars that need percent-encoding will be encoded by withQuery().
348
+ $key = strtr($key, self::$replaceQuery);
349
+
350
  if ($value !== null) {
351
+ $result[] = $key . '=' . strtr($value, self::$replaceQuery);
352
  } else {
353
  $result[] = $key;
354
  }
355
+
356
+ return $uri->withQuery(implode('&', $result));
357
  }
358
+
359
  /**
360
  * Creates a URI from a hash of `parse_url` components.
361
  *
371
  $uri = new self();
372
  $uri->applyParts($parts);
373
  $uri->validateState();
374
+
375
  return $uri;
376
  }
377
+
378
  public function getScheme()
379
  {
380
  return $this->scheme;
381
  }
382
+
383
  public function getAuthority()
384
  {
385
  $authority = $this->host;
386
  if ($this->userInfo !== '') {
387
  $authority = $this->userInfo . '@' . $authority;
388
  }
389
+
390
  if ($this->port !== null) {
391
  $authority .= ':' . $this->port;
392
  }
393
+
394
  return $authority;
395
  }
396
+
397
  public function getUserInfo()
398
  {
399
  return $this->userInfo;
400
  }
401
+
402
  public function getHost()
403
  {
404
  return $this->host;
405
  }
406
+
407
  public function getPort()
408
  {
409
  return $this->port;
410
  }
411
+
412
  public function getPath()
413
  {
414
  return $this->path;
415
  }
416
+
417
  public function getQuery()
418
  {
419
  return $this->query;
420
  }
421
+
422
  public function getFragment()
423
  {
424
  return $this->fragment;
425
  }
426
+
427
  public function withScheme($scheme)
428
  {
429
  $scheme = $this->filterScheme($scheme);
430
+
431
  if ($this->scheme === $scheme) {
432
  return $this;
433
  }
434
+
435
  $new = clone $this;
436
  $new->scheme = $scheme;
437
  $new->removeDefaultPort();
438
  $new->validateState();
439
+
440
  return $new;
441
  }
442
+
443
  public function withUserInfo($user, $password = null)
444
  {
445
  $info = $user;
446
  if ($password != '') {
447
  $info .= ':' . $password;
448
  }
449
+
450
  if ($this->userInfo === $info) {
451
  return $this;
452
  }
453
+
454
  $new = clone $this;
455
  $new->userInfo = $info;
456
  $new->validateState();
457
+
458
  return $new;
459
  }
460
+
461
  public function withHost($host)
462
  {
463
  $host = $this->filterHost($host);
464
+
465
  if ($this->host === $host) {
466
  return $this;
467
  }
468
+
469
  $new = clone $this;
470
  $new->host = $host;
471
  $new->validateState();
472
+
473
  return $new;
474
  }
475
+
476
  public function withPort($port)
477
  {
478
  $port = $this->filterPort($port);
479
+
480
  if ($this->port === $port) {
481
  return $this;
482
  }
483
+
484
  $new = clone $this;
485
  $new->port = $port;
486
  $new->removeDefaultPort();
487
  $new->validateState();
488
+
489
  return $new;
490
  }
491
+
492
  public function withPath($path)
493
  {
494
  $path = $this->filterPath($path);
495
+
496
  if ($this->path === $path) {
497
  return $this;
498
  }
499
+
500
  $new = clone $this;
501
  $new->path = $path;
502
  $new->validateState();
503
+
504
  return $new;
505
  }
506
+
507
  public function withQuery($query)
508
  {
509
  $query = $this->filterQueryAndFragment($query);
510
+
511
  if ($this->query === $query) {
512
  return $this;
513
  }
514
+
515
  $new = clone $this;
516
  $new->query = $query;
517
+
518
  return $new;
519
  }
520
+
521
  public function withFragment($fragment)
522
  {
523
  $fragment = $this->filterQueryAndFragment($fragment);
524
+
525
  if ($this->fragment === $fragment) {
526
  return $this;
527
  }
528
+
529
  $new = clone $this;
530
  $new->fragment = $fragment;
531
+
532
  return $new;
533
  }
534
+
535
  /**
536
  * Apply parse_url parts to a URI.
537
  *
539
  */
540
  private function applyParts(array $parts)
541
  {
542
+ $this->scheme = isset($parts['scheme'])
543
+ ? $this->filterScheme($parts['scheme'])
544
+ : '';
545
  $this->userInfo = isset($parts['user']) ? $parts['user'] : '';
546
+ $this->host = isset($parts['host'])
547
+ ? $this->filterHost($parts['host'])
548
+ : '';
549
+ $this->port = isset($parts['port'])
550
+ ? $this->filterPort($parts['port'])
551
+ : null;
552
+ $this->path = isset($parts['path'])
553
+ ? $this->filterPath($parts['path'])
554
+ : '';
555
+ $this->query = isset($parts['query'])
556
+ ? $this->filterQueryAndFragment($parts['query'])
557
+ : '';
558
+ $this->fragment = isset($parts['fragment'])
559
+ ? $this->filterQueryAndFragment($parts['fragment'])
560
+ : '';
561
  if (isset($parts['pass'])) {
562
  $this->userInfo .= ':' . $parts['pass'];
563
  }
564
+
565
  $this->removeDefaultPort();
566
  }
567
+
568
  /**
569
  * @param string $scheme
570
  *
574
  */
575
  private function filterScheme($scheme)
576
  {
577
+ if (!is_string($scheme)) {
578
  throw new \InvalidArgumentException('Scheme must be a string');
579
  }
580
+
581
+ return strtolower($scheme);
582
  }
583
+
584
  /**
585
  * @param string $host
586
  *
590
  */
591
  private function filterHost($host)
592
  {
593
+ if (!is_string($host)) {
594
  throw new \InvalidArgumentException('Host must be a string');
595
  }
596
+
597
+ return strtolower($host);
598
  }
599
+
600
  /**
601
  * @param int|null $port
602
  *
609
  if ($port === null) {
610
  return null;
611
  }
612
+
613
  $port = (int) $port;
614
  if (1 > $port || 0xffff < $port) {
615
+ throw new \InvalidArgumentException(
616
+ sprintf('Invalid port: %d. Must be between 1 and 65535', $port)
617
+ );
618
  }
619
+
620
  return $port;
621
  }
622
+
623
  private function removeDefaultPort()
624
  {
625
  if ($this->port !== null && self::isDefaultPort($this)) {
626
  $this->port = null;
627
  }
628
  }
629
+
630
  /**
631
  * Filters the path of a URI
632
  *
638
  */
639
  private function filterPath($path)
640
  {
641
+ if (!is_string($path)) {
642
  throw new \InvalidArgumentException('Path must be a string');
643
  }
644
+
645
+ return preg_replace_callback(
646
+ '/(?:[^' . self::$charUnreserved . self::$charSubDelims . '%:@\/]++|%(?![A-Fa-f0-9]{2}))/',
647
+ [$this, 'rawurlencodeMatchZero'],
648
+ $path
649
+ );
650
  }
651
+
652
  /**
653
  * Filters the query string or fragment of a URI.
654
  *
660
  */
661
  private function filterQueryAndFragment($str)
662
  {
663
+ if (!is_string($str)) {
664
  throw new \InvalidArgumentException('Query and fragment must be a string');
665
  }
666
+
667
+ return preg_replace_callback(
668
+ '/(?:[^' . self::$charUnreserved . self::$charSubDelims . '%:@\/\?]++|%(?![A-Fa-f0-9]{2}))/',
669
+ [$this, 'rawurlencodeMatchZero'],
670
+ $str
671
+ );
672
  }
673
+
674
  private function rawurlencodeMatchZero(array $match)
675
  {
676
+ return rawurlencode($match[0]);
677
  }
678
+
679
  private function validateState()
680
  {
681
  if ($this->host === '' && ($this->scheme === 'http' || $this->scheme === 'https')) {
682
  $this->host = self::HTTP_DEFAULT_HOST;
683
  }
684
+
685
  if ($this->getAuthority() === '') {
686
+ if (0 === strpos($this->path, '//')) {
687
  throw new \InvalidArgumentException('The path of a URI without an authority must not start with two slashes "//"');
688
  }
689
+ if ($this->scheme === '' && false !== strpos(explode('/', $this->path, 2)[0], ':')) {
690
  throw new \InvalidArgumentException('A relative URI must not have a path beginning with a segment containing a colon');
691
  }
692
  } elseif (isset($this->path[0]) && $this->path[0] !== '/') {
693
+ @trigger_error(
694
+ 'The path of a URI with an authority must start with a slash "/" or be empty. Automagically fixing the URI ' .
695
+ 'by adding a leading slash to the path is deprecated since version 1.4 and will throw an exception instead.',
696
+ E_USER_DEPRECATED
697
+ );
698
+ $this->path = '/'. $this->path;
699
  //throw new \InvalidArgumentException('The path of a URI with an authority must start with a slash "/" or be empty');
700
  }
701
  }
includes/mollie-api-php/vendor/guzzlehttp/psr7/src/UriNormalizer.php CHANGED
@@ -1,8 +1,8 @@
1
  <?php
 
2
 
3
- namespace _PhpScoper5b6804f9734c8\GuzzleHttp\Psr7;
4
 
5
- use _PhpScoper5b6804f9734c8\Psr\Http\Message\UriInterface;
6
  /**
7
  * Provides methods to normalize and compare URIs.
8
  *
@@ -19,12 +19,14 @@ final class UriNormalizer
19
  * self::REMOVE_DEFAULT_HOST | self::REMOVE_DEFAULT_PORT | self::REMOVE_DOT_SEGMENTS
20
  */
21
  const PRESERVING_NORMALIZATIONS = 63;
 
22
  /**
23
  * All letters within a percent-encoding triplet (e.g., "%3A") are case-insensitive, and should be capitalized.
24
  *
25
  * Example: http://example.org/a%c2%b1b → http://example.org/a%C2%B1b
26
  */
27
  const CAPITALIZE_PERCENT_ENCODING = 1;
 
28
  /**
29
  * Decodes percent-encoded octets of unreserved characters.
30
  *
@@ -35,12 +37,14 @@ final class UriNormalizer
35
  * Example: http://example.org/%7Eusern%61me/ → http://example.org/~username/
36
  */
37
  const DECODE_UNRESERVED_CHARACTERS = 2;
 
38
  /**
39
  * Converts the empty path to "/" for http and https URIs.
40
  *
41
  * Example: http://example.org → http://example.org/
42
  */
43
  const CONVERT_EMPTY_PATH = 4;
 
44
  /**
45
  * Removes the default host of the given URI scheme from the URI.
46
  *
@@ -53,12 +57,14 @@ final class UriNormalizer
53
  * Example: file://localhost/myfile → file:///myfile
54
  */
55
  const REMOVE_DEFAULT_HOST = 8;
 
56
  /**
57
  * Removes the default port of the given URI scheme from the URI.
58
  *
59
  * Example: http://example.org:80/ → http://example.org/
60
  */
61
  const REMOVE_DEFAULT_PORT = 16;
 
62
  /**
63
  * Removes unnecessary dot-segments.
64
  *
@@ -68,6 +74,7 @@ final class UriNormalizer
68
  * Example: http://example.org/../a/b/../c/./d.html → http://example.org/a/c/d.html
69
  */
70
  const REMOVE_DOT_SEGMENTS = 32;
 
71
  /**
72
  * Paths which include two or more adjacent slashes are converted to one.
73
  *
@@ -78,6 +85,7 @@ final class UriNormalizer
78
  * Example: http://example.org//foo///bar.html → http://example.org/foo/bar.html
79
  */
80
  const REMOVE_DUPLICATE_SLASHES = 64;
 
81
  /**
82
  * Sort query parameters with their values in alphabetical order.
83
  *
@@ -90,6 +98,7 @@ final class UriNormalizer
90
  * purpose is to be able to compare URIs in a reproducible way, not to have the params sorted perfectly.
91
  */
92
  const SORT_QUERY_PARAMETERS = 128;
 
93
  /**
94
  * Returns a normalized URI.
95
  *
@@ -107,36 +116,47 @@ final class UriNormalizer
107
  * @return UriInterface The normalized URI
108
  * @link https://tools.ietf.org/html/rfc3986#section-6.2
109
  */
110
- public static function normalize(\_PhpScoper5b6804f9734c8\Psr\Http\Message\UriInterface $uri, $flags = self::PRESERVING_NORMALIZATIONS)
111
  {
112
  if ($flags & self::CAPITALIZE_PERCENT_ENCODING) {
113
  $uri = self::capitalizePercentEncoding($uri);
114
  }
 
115
  if ($flags & self::DECODE_UNRESERVED_CHARACTERS) {
116
  $uri = self::decodeUnreservedCharacters($uri);
117
  }
118
- if ($flags & self::CONVERT_EMPTY_PATH && $uri->getPath() === '' && ($uri->getScheme() === 'http' || $uri->getScheme() === 'https')) {
 
 
 
119
  $uri = $uri->withPath('/');
120
  }
 
121
  if ($flags & self::REMOVE_DEFAULT_HOST && $uri->getScheme() === 'file' && $uri->getHost() === 'localhost') {
122
  $uri = $uri->withHost('');
123
  }
124
- if ($flags & self::REMOVE_DEFAULT_PORT && $uri->getPort() !== null && \_PhpScoper5b6804f9734c8\GuzzleHttp\Psr7\Uri::isDefaultPort($uri)) {
 
125
  $uri = $uri->withPort(null);
126
  }
127
- if ($flags & self::REMOVE_DOT_SEGMENTS && !\_PhpScoper5b6804f9734c8\GuzzleHttp\Psr7\Uri::isRelativePathReference($uri)) {
128
- $uri = $uri->withPath(\_PhpScoper5b6804f9734c8\GuzzleHttp\Psr7\UriResolver::removeDotSegments($uri->getPath()));
 
129
  }
 
130
  if ($flags & self::REMOVE_DUPLICATE_SLASHES) {
131
- $uri = $uri->withPath(\preg_replace('#//++#', '/', $uri->getPath()));
132
  }
 
133
  if ($flags & self::SORT_QUERY_PARAMETERS && $uri->getQuery() !== '') {
134
- $queryKeyValues = \explode('&', $uri->getQuery());
135
- \sort($queryKeyValues);
136
- $uri = $uri->withQuery(\implode('&', $queryKeyValues));
137
  }
 
138
  return $uri;
139
  }
 
140
  /**
141
  * Whether two URIs can be considered equivalent.
142
  *
@@ -152,26 +172,43 @@ final class UriNormalizer
152
  * @return bool
153
  * @link https://tools.ietf.org/html/rfc3986#section-6.1
154
  */
155
- public static function isEquivalent(\_PhpScoper5b6804f9734c8\Psr\Http\Message\UriInterface $uri1, \_PhpScoper5b6804f9734c8\Psr\Http\Message\UriInterface $uri2, $normalizations = self::PRESERVING_NORMALIZATIONS)
156
  {
157
  return (string) self::normalize($uri1, $normalizations) === (string) self::normalize($uri2, $normalizations);
158
  }
159
- private static function capitalizePercentEncoding(\_PhpScoper5b6804f9734c8\Psr\Http\Message\UriInterface $uri)
 
160
  {
161
  $regex = '/(?:%[A-Fa-f0-9]{2})++/';
 
162
  $callback = function (array $match) {
163
- return \strtoupper($match[0]);
164
  };
165
- return $uri->withPath(\preg_replace_callback($regex, $callback, $uri->getPath()))->withQuery(\preg_replace_callback($regex, $callback, $uri->getQuery()));
 
 
 
 
 
 
166
  }
167
- private static function decodeUnreservedCharacters(\_PhpScoper5b6804f9734c8\Psr\Http\Message\UriInterface $uri)
 
168
  {
169
  $regex = '/%(?:2D|2E|5F|7E|3[0-9]|[46][1-9A-F]|[57][0-9A])/i';
 
170
  $callback = function (array $match) {
171
- return \rawurldecode($match[0]);
172
  };
173
- return $uri->withPath(\preg_replace_callback($regex, $callback, $uri->getPath()))->withQuery(\preg_replace_callback($regex, $callback, $uri->getQuery()));
 
 
 
 
 
 
174
  }
 
175
  private function __construct()
176
  {
177
  // cannot be instantiated
1
  <?php
2
+ namespace GuzzleHttp\Psr7;
3
 
4
+ use Psr\Http\Message\UriInterface;
5
 
 
6
  /**
7
  * Provides methods to normalize and compare URIs.
8
  *
19
  * self::REMOVE_DEFAULT_HOST | self::REMOVE_DEFAULT_PORT | self::REMOVE_DOT_SEGMENTS
20
  */
21
  const PRESERVING_NORMALIZATIONS = 63;
22
+
23
  /**
24
  * All letters within a percent-encoding triplet (e.g., "%3A") are case-insensitive, and should be capitalized.
25
  *
26
  * Example: http://example.org/a%c2%b1b → http://example.org/a%C2%B1b
27
  */
28
  const CAPITALIZE_PERCENT_ENCODING = 1;
29
+
30
  /**
31
  * Decodes percent-encoded octets of unreserved characters.
32
  *
37
  * Example: http://example.org/%7Eusern%61me/ → http://example.org/~username/
38
  */
39
  const DECODE_UNRESERVED_CHARACTERS = 2;
40
+
41
  /**
42
  * Converts the empty path to "/" for http and https URIs.
43
  *
44
  * Example: http://example.org → http://example.org/
45
  */
46
  const CONVERT_EMPTY_PATH = 4;
47
+
48
  /**
49
  * Removes the default host of the given URI scheme from the URI.
50
  *
57
  * Example: file://localhost/myfile → file:///myfile
58
  */
59
  const REMOVE_DEFAULT_HOST = 8;
60
+
61
  /**
62
  * Removes the default port of the given URI scheme from the URI.
63
  *
64
  * Example: http://example.org:80/ → http://example.org/
65
  */
66
  const REMOVE_DEFAULT_PORT = 16;
67
+
68
  /**
69
  * Removes unnecessary dot-segments.
70
  *
74
  * Example: http://example.org/../a/b/../c/./d.html → http://example.org/a/c/d.html
75
  */
76
  const REMOVE_DOT_SEGMENTS = 32;
77
+
78
  /**
79
  * Paths which include two or more adjacent slashes are converted to one.
80
  *
85
  * Example: http://example.org//foo///bar.html → http://example.org/foo/bar.html
86
  */
87
  const REMOVE_DUPLICATE_SLASHES = 64;
88
+
89
  /**
90
  * Sort query parameters with their values in alphabetical order.
91
  *
98
  * purpose is to be able to compare URIs in a reproducible way, not to have the params sorted perfectly.
99
  */
100
  const SORT_QUERY_PARAMETERS = 128;
101
+
102
  /**
103
  * Returns a normalized URI.
104
  *
116
  * @return UriInterface The normalized URI
117
  * @link https://tools.ietf.org/html/rfc3986#section-6.2
118
  */
119
+ public static function normalize(UriInterface $uri, $flags = self::PRESERVING_NORMALIZATIONS)
120
  {
121
  if ($flags & self::CAPITALIZE_PERCENT_ENCODING) {
122
  $uri = self::capitalizePercentEncoding($uri);
123
  }
124
+
125
  if ($flags & self::DECODE_UNRESERVED_CHARACTERS) {
126
  $uri = self::decodeUnreservedCharacters($uri);
127
  }
128
+
129
+ if ($flags & self::CONVERT_EMPTY_PATH && $uri->getPath() === '' &&
130
+ ($uri->getScheme() === 'http' || $uri->getScheme() === 'https')
131
+ ) {
132
  $uri = $uri->withPath('/');
133
  }
134
+
135
  if ($flags & self::REMOVE_DEFAULT_HOST && $uri->getScheme() === 'file' && $uri->getHost() === 'localhost') {
136
  $uri = $uri->withHost('');
137
  }
138
+
139
+ if ($flags & self::REMOVE_DEFAULT_PORT && $uri->getPort() !== null && Uri::isDefaultPort($uri)) {
140
  $uri = $uri->withPort(null);
141
  }
142
+
143
+ if ($flags & self::REMOVE_DOT_SEGMENTS && !Uri::isRelativePathReference($uri)) {
144
+ $uri = $uri->withPath(UriResolver::removeDotSegments($uri->getPath()));
145
  }
146
+
147
  if ($flags & self::REMOVE_DUPLICATE_SLASHES) {
148
+ $uri = $uri->withPath(preg_replace('#//++#', '/', $uri->getPath()));
149
  }
150
+
151
  if ($flags & self::SORT_QUERY_PARAMETERS && $uri->getQuery() !== '') {
152
+ $queryKeyValues = explode('&', $uri->getQuery());
153
+ sort($queryKeyValues);
154
+ $uri = $uri->withQuery(implode('&', $queryKeyValues));
155
  }
156
+
157
  return $uri;
158
  }
159
+
160
  /**
161
  * Whether two URIs can be considered equivalent.
162
  *
172
  * @return bool
173
  * @link https://tools.ietf.org/html/rfc3986#section-6.1
174
  */
175
+ public static function isEquivalent(UriInterface $uri1, UriInterface $uri2, $normalizations = self::PRESERVING_NORMALIZATIONS)
176
  {
177
  return (string) self::normalize($uri1, $normalizations) === (string) self::normalize($uri2, $normalizations);
178
  }
179
+
180
+ private static function capitalizePercentEncoding(UriInterface $uri)
181
  {
182
  $regex = '/(?:%[A-Fa-f0-9]{2})++/';
183
+
184
  $callback = function (array $match) {
185
+ return strtoupper($match[0]);
186
  };
187
+
188
+ return
189
+ $uri->withPath(
190
+ preg_replace_callback($regex, $callback, $uri->getPath())
191
+ )->withQuery(
192
+ preg_replace_callback($regex, $callback, $uri->getQuery())
193
+ );
194
  }
195
+
196
+ private static function decodeUnreservedCharacters(UriInterface $uri)
197
  {
198
  $regex = '/%(?:2D|2E|5F|7E|3[0-9]|[46][1-9A-F]|[57][0-9A])/i';
199
+
200
  $callback = function (array $match) {
201
+ return rawurldecode($match[0]);
202
  };
203
+
204
+ return
205
+ $uri->withPath(
206
+ preg_replace_callback($regex, $callback, $uri->getPath())
207
+ )->withQuery(
208
+ preg_replace_callback($regex, $callback, $uri->getQuery())
209
+ );
210
  }
211
+
212
  private function __construct()
213
  {
214
  // cannot be instantiated
includes/mollie-api-php/vendor/guzzlehttp/psr7/src/UriResolver.php CHANGED
@@ -1,8 +1,8 @@
1
  <?php
 
2
 
3
- namespace _PhpScoper5b6804f9734c8\GuzzleHttp\Psr7;
4
 
5
- use _PhpScoper5b6804f9734c8\Psr\Http\Message\UriInterface;
6
  /**
7
  * Resolves a URI reference in the context of a base URI and the opposite way.
8
  *
@@ -25,16 +25,19 @@ final class UriResolver
25
  if ($path === '' || $path === '/') {
26
  return $path;
27
  }
 
28
  $results = [];
29
- $segments = \explode('/', $path);
30
  foreach ($segments as $segment) {
31
  if ($segment === '..') {
32
- \array_pop($results);
33
  } elseif ($segment !== '.') {
34
  $results[] = $segment;
35
  }
36
  }
37
- $newPath = \implode('/', $results);
 
 
38
  if ($path[0] === '/' && (!isset($newPath[0]) || $newPath[0] !== '/')) {
39
  // Re-add the leading slash if necessary for cases like "/.."
40
  $newPath = '/' . $newPath;
@@ -43,8 +46,10 @@ final class UriResolver
43
  // If newPath is not empty, then $segment must be set and is the last segment from the foreach
44
  $newPath .= '/';
45
  }
 
46
  return $newPath;
47
  }
 
48
  /**
49
  * Converts the relative URI into a new URI that is resolved against the base URI.
50
  *
@@ -54,15 +59,17 @@ final class UriResolver
54
  * @return UriInterface
55
  * @link http://tools.ietf.org/html/rfc3986#section-5.2
56
  */
57
- public static function resolve(\_PhpScoper5b6804f9734c8\Psr\Http\Message\UriInterface $base, \_PhpScoper5b6804f9734c8\Psr\Http\Message\UriInterface $rel)
58
  {
59
  if ((string) $rel === '') {
60
  // we can simply return the same base URI instance for this same-document reference
61
  return $base;
62
  }
 
63
  if ($rel->getScheme() != '') {
64
  return $rel->withPath(self::removeDotSegments($rel->getPath()));
65
  }
 
66
  if ($rel->getAuthority() != '') {
67
  $targetAuthority = $rel->getAuthority();
68
  $targetPath = self::removeDotSegments($rel->getPath());
@@ -79,11 +86,11 @@ final class UriResolver
79
  if ($targetAuthority != '' && $base->getPath() === '') {
80
  $targetPath = '/' . $rel->getPath();
81
  } else {
82
- $lastSlashPos = \strrpos($base->getPath(), '/');
83
- if ($lastSlashPos === \false) {
84
  $targetPath = $rel->getPath();
85
  } else {
86
- $targetPath = \substr($base->getPath(), 0, $lastSlashPos + 1) . $rel->getPath();
87
  }
88
  }
89
  }
@@ -91,8 +98,16 @@ final class UriResolver
91
  $targetQuery = $rel->getQuery();
92
  }
93
  }
94
- return new \_PhpScoper5b6804f9734c8\GuzzleHttp\Psr7\Uri(\_PhpScoper5b6804f9734c8\GuzzleHttp\Psr7\Uri::composeComponents($base->getScheme(), $targetAuthority, $targetPath, $targetQuery, $rel->getFragment()));
 
 
 
 
 
 
 
95
  }
 
96
  /**
97
  * Returns the target URI as a relative reference from the base URI.
98
  *
@@ -119,46 +134,57 @@ final class UriResolver
119
  *
120
  * @return UriInterface The relative URI reference
121
  */
122
- public static function relativize(\_PhpScoper5b6804f9734c8\Psr\Http\Message\UriInterface $base, \_PhpScoper5b6804f9734c8\Psr\Http\Message\UriInterface $target)
123
  {
124
- if ($target->getScheme() !== '' && ($base->getScheme() !== $target->getScheme() || $target->getAuthority() === '' && $base->getAuthority() !== '')) {
 
 
125
  return $target;
126
  }
127
- if (\_PhpScoper5b6804f9734c8\GuzzleHttp\Psr7\Uri::isRelativePathReference($target)) {
 
128
  // As the target is already highly relative we return it as-is. It would be possible to resolve
129
  // the target with `$target = self::resolve($base, $target);` and then try make it more relative
130
  // by removing a duplicate query. But let's not do that automatically.
131
  return $target;
132
  }
 
133
  if ($target->getAuthority() !== '' && $base->getAuthority() !== $target->getAuthority()) {
134
  return $target->withScheme('');
135
  }
 
136
  // We must remove the path before removing the authority because if the path starts with two slashes, the URI
137
  // would turn invalid. And we also cannot set a relative path before removing the authority, as that is also
138
  // invalid.
139
  $emptyPathUri = $target->withScheme('')->withPath('')->withUserInfo('')->withPort(null)->withHost('');
 
140
  if ($base->getPath() !== $target->getPath()) {
141
  return $emptyPathUri->withPath(self::getRelativePath($base, $target));
142
  }
 
143
  if ($base->getQuery() === $target->getQuery()) {
144
  // Only the target fragment is left. And it must be returned even if base and target fragment are the same.
145
  return $emptyPathUri->withQuery('');
146
  }
 
147
  // If the base URI has a query but the target has none, we cannot return an empty path reference as it would
148
  // inherit the base query component when resolving.
149
  if ($target->getQuery() === '') {
150
- $segments = \explode('/', $target->getPath());
151
- $lastSegment = \end($segments);
 
152
  return $emptyPathUri->withPath($lastSegment === '' ? './' : $lastSegment);
153
  }
 
154
  return $emptyPathUri;
155
  }
156
- private static function getRelativePath(\_PhpScoper5b6804f9734c8\Psr\Http\Message\UriInterface $base, \_PhpScoper5b6804f9734c8\Psr\Http\Message\UriInterface $target)
 
157
  {
158
- $sourceSegments = \explode('/', $base->getPath());
159
- $targetSegments = \explode('/', $target->getPath());
160
- \array_pop($sourceSegments);
161
- $targetLastSegment = \array_pop($targetSegments);
162
  foreach ($sourceSegments as $i => $segment) {
163
  if (isset($targetSegments[$i]) && $segment === $targetSegments[$i]) {
164
  unset($sourceSegments[$i], $targetSegments[$i]);
@@ -167,22 +193,25 @@ final class UriResolver
167
  }
168
  }
169
  $targetSegments[] = $targetLastSegment;
170
- $relativePath = \str_repeat('../', \count($sourceSegments)) . \implode('/', $targetSegments);
 
171
  // A reference to am empty last segment or an empty first sub-segment must be prefixed with "./".
172
  // This also applies to a segment with a colon character (e.g., "file:colon") that cannot be used
173
  // as the first segment of a relative-path reference, as it would be mistaken for a scheme name.
174
- if ('' === $relativePath || \false !== \strpos(\explode('/', $relativePath, 2)[0], ':')) {
175
- $relativePath = "./{$relativePath}";
176
  } elseif ('/' === $relativePath[0]) {
177
  if ($base->getAuthority() != '' && $base->getPath() === '') {
178
  // In this case an extra slash is added by resolve() automatically. So we must not add one here.
179
- $relativePath = ".{$relativePath}";
180
  } else {
181
- $relativePath = "./{$relativePath}";
182
  }
183
  }
 
184
  return $relativePath;
185
  }
 
186
  private function __construct()
187
  {
188
  // cannot be instantiated
1
  <?php
2
+ namespace GuzzleHttp\Psr7;
3
 
4
+ use Psr\Http\Message\UriInterface;
5
 
 
6
  /**
7
  * Resolves a URI reference in the context of a base URI and the opposite way.
8
  *
25
  if ($path === '' || $path === '/') {
26
  return $path;
27
  }
28
+
29
  $results = [];
30
+ $segments = explode('/', $path);
31
  foreach ($segments as $segment) {
32
  if ($segment === '..') {
33
+ array_pop($results);
34
  } elseif ($segment !== '.') {
35
  $results[] = $segment;
36
  }
37
  }
38
+
39
+ $newPath = implode('/', $results);
40
+
41
  if ($path[0] === '/' && (!isset($newPath[0]) || $newPath[0] !== '/')) {
42
  // Re-add the leading slash if necessary for cases like "/.."
43
  $newPath = '/' . $newPath;
46
  // If newPath is not empty, then $segment must be set and is the last segment from the foreach
47
  $newPath .= '/';
48
  }
49
+
50
  return $newPath;
51
  }
52
+
53
  /**
54
  * Converts the relative URI into a new URI that is resolved against the base URI.
55
  *
59
  * @return UriInterface
60
  * @link http://tools.ietf.org/html/rfc3986#section-5.2
61
  */
62
+ public static function resolve(UriInterface $base, UriInterface $rel)
63
  {
64
  if ((string) $rel === '') {
65
  // we can simply return the same base URI instance for this same-document reference
66
  return $base;
67
  }
68
+
69
  if ($rel->getScheme() != '') {
70
  return $rel->withPath(self::removeDotSegments($rel->getPath()));
71
  }
72
+
73
  if ($rel->getAuthority() != '') {
74
  $targetAuthority = $rel->getAuthority();
75
  $targetPath = self::removeDotSegments($rel->getPath());
86
  if ($targetAuthority != '' && $base->getPath() === '') {
87
  $targetPath = '/' . $rel->getPath();
88
  } else {
89
+ $lastSlashPos = strrpos($base->getPath(), '/');
90
+ if ($lastSlashPos === false) {
91
  $targetPath = $rel->getPath();
92
  } else {
93
+ $targetPath = substr($base->getPath(), 0, $lastSlashPos + 1) . $rel->getPath();
94
  }
95
  }
96
  }
98
  $targetQuery = $rel->getQuery();
99
  }
100
  }
101
+
102
+ return new Uri(Uri::composeComponents(
103
+ $base->getScheme(),
104
+ $targetAuthority,
105
+ $targetPath,
106
+ $targetQuery,
107
+ $rel->getFragment()
108
+ ));
109
  }
110
+
111
  /**
112
  * Returns the target URI as a relative reference from the base URI.
113
  *
134
  *
135
  * @return UriInterface The relative URI reference
136
  */
137
+ public static function relativize(UriInterface $base, UriInterface $target)
138
  {
139
+ if ($target->getScheme() !== '' &&
140
+ ($base->getScheme() !== $target->getScheme() || $target->getAuthority() === '' && $base->getAuthority() !== '')
141
+ ) {
142
  return $target;
143
  }
144
+
145
+ if (Uri::isRelativePathReference($target)) {
146
  // As the target is already highly relative we return it as-is. It would be possible to resolve
147
  // the target with `$target = self::resolve($base, $target);` and then try make it more relative
148
  // by removing a duplicate query. But let's not do that automatically.
149
  return $target;
150
  }
151
+
152
  if ($target->getAuthority() !== '' && $base->getAuthority() !== $target->getAuthority()) {
153
  return $target->withScheme('');
154
  }
155
+
156
  // We must remove the path before removing the authority because if the path starts with two slashes, the URI
157
  // would turn invalid. And we also cannot set a relative path before removing the authority, as that is also
158
  // invalid.
159
  $emptyPathUri = $target->withScheme('')->withPath('')->withUserInfo('')->withPort(null)->withHost('');
160
+
161
  if ($base->getPath() !== $target->getPath()) {
162
  return $emptyPathUri->withPath(self::getRelativePath($base, $target));
163
  }
164
+
165
  if ($base->getQuery() === $target->getQuery()) {
166
  // Only the target fragment is left. And it must be returned even if base and target fragment are the same.
167
  return $emptyPathUri->withQuery('');
168
  }
169
+
170
  // If the base URI has a query but the target has none, we cannot return an empty path reference as it would
171
  // inherit the base query component when resolving.
172
  if ($target->getQuery() === '') {
173
+ $segments = explode('/', $target->getPath());
174
+ $lastSegment = end($segments);
175
+
176
  return $emptyPathUri->withPath($lastSegment === '' ? './' : $lastSegment);
177
  }
178
+
179
  return $emptyPathUri;
180
  }
181
+
182
+ private static function getRelativePath(UriInterface $base, UriInterface $target)
183
  {
184
+ $sourceSegments = explode('/', $base->getPath());
185
+ $targetSegments = explode('/', $target->getPath());
186
+ array_pop($sourceSegments);
187
+ $targetLastSegment = array_pop($targetSegments);
188
  foreach ($sourceSegments as $i => $segment) {
189
  if (isset($targetSegments[$i]) && $segment === $targetSegments[$i]) {
190
  unset($sourceSegments[$i], $targetSegments[$i]);
193
  }
194
  }
195
  $targetSegments[] = $targetLastSegment;
196
+ $relativePath = str_repeat('../', count($sourceSegments)) . implode('/', $targetSegments);
197
+
198
  // A reference to am empty last segment or an empty first sub-segment must be prefixed with "./".
199
  // This also applies to a segment with a colon character (e.g., "file:colon") that cannot be used
200
  // as the first segment of a relative-path reference, as it would be mistaken for a scheme name.
201
+ if ('' === $relativePath || false !== strpos(explode('/', $relativePath, 2)[0], ':')) {
202
+ $relativePath = "./$relativePath";
203
  } elseif ('/' === $relativePath[0]) {
204
  if ($base->getAuthority() != '' && $base->getPath() === '') {
205
  // In this case an extra slash is added by resolve() automatically. So we must not add one here.
206
+ $relativePath = ".$relativePath";
207
  } else {
208
+ $relativePath = "./$relativePath";
209
  }
210
  }
211
+
212
  return $relativePath;
213
  }
214
+
215
  private function __construct()
216
  {
217
  // cannot be instantiated
includes/mollie-api-php/vendor/guzzlehttp/psr7/src/functions.php CHANGED
@@ -1,13 +1,13 @@
1
  <?php
 
2
 
3
- namespace _PhpScoper5b6804f9734c8\GuzzleHttp\Psr7;
 
 
 
 
 
4
 
5
- use _PhpScoper5b6804f9734c8\Psr\Http\Message\MessageInterface;
6
- use _PhpScoper5b6804f9734c8\Psr\Http\Message\RequestInterface;
7
- use _PhpScoper5b6804f9734c8\Psr\Http\Message\ResponseInterface;
8
- use _PhpScoper5b6804f9734c8\Psr\Http\Message\ServerRequestInterface;
9
- use _PhpScoper5b6804f9734c8\Psr\Http\Message\StreamInterface;
10
- use _PhpScoper5b6804f9734c8\Psr\Http\Message\UriInterface;
11
  /**
12
  * Returns the string representation of an HTTP message.
13
  *
@@ -15,23 +15,30 @@ use _PhpScoper5b6804f9734c8\Psr\Http\Message\UriInterface;
15
  *
16
  * @return string
17
  */
18
- function str(\_PhpScoper5b6804f9734c8\Psr\Http\Message\MessageInterface $message)
19
  {
20
- if ($message instanceof \_PhpScoper5b6804f9734c8\Psr\Http\Message\RequestInterface) {
21
- $msg = \trim($message->getMethod() . ' ' . $message->getRequestTarget()) . ' HTTP/' . $message->getProtocolVersion();
 
 
22
  if (!$message->hasHeader('host')) {
23
  $msg .= "\r\nHost: " . $message->getUri()->getHost();
24
  }
25
- } elseif ($message instanceof \_PhpScoper5b6804f9734c8\Psr\Http\Message\ResponseInterface) {
26
- $msg = 'HTTP/' . $message->getProtocolVersion() . ' ' . $message->getStatusCode() . ' ' . $message->getReasonPhrase();
 
 
27
  } else {
28
  throw new \InvalidArgumentException('Unknown message type');
29
  }
 
30
  foreach ($message->getHeaders() as $name => $values) {
31
- $msg .= "\r\n{$name}: " . \implode(', ', $values);
32
  }
 
33
  return "{$msg}\r\n\r\n" . $message->getBody();
34
  }
 
35
  /**
36
  * Returns a UriInterface for the given value.
37
  *
@@ -46,13 +53,15 @@ function str(\_PhpScoper5b6804f9734c8\Psr\Http\Message\MessageInterface $message
46
  */
47
  function uri_for($uri)
48
  {
49
- if ($uri instanceof \_PhpScoper5b6804f9734c8\Psr\Http\Message\UriInterface) {
50
  return $uri;
51
- } elseif (\is_string($uri)) {
52
- return new \_PhpScoper5b6804f9734c8\GuzzleHttp\Psr7\Uri($uri);
53
  }
 
54
  throw new \InvalidArgumentException('URI must be a string or UriInterface');
55
  }
 
56
  /**
57
  * Create a new stream based on the input type.
58
  *
@@ -68,41 +77,45 @@ function uri_for($uri)
68
  */
69
  function stream_for($resource = '', array $options = [])
70
  {
71
- if (\is_scalar($resource)) {
72
- $stream = \fopen('php://temp', 'r+');
73
  if ($resource !== '') {
74
- \fwrite($stream, $resource);
75
- \fseek($stream, 0);
76
  }
77
- return new \_PhpScoper5b6804f9734c8\GuzzleHttp\Psr7\Stream($stream, $options);
78
  }
79
- switch (\gettype($resource)) {
 
80
  case 'resource':
81
- return new \_PhpScoper5b6804f9734c8\GuzzleHttp\Psr7\Stream($resource, $options);
82
  case 'object':
83
- if ($resource instanceof \_PhpScoper5b6804f9734c8\Psr\Http\Message\StreamInterface) {
84
  return $resource;
85
  } elseif ($resource instanceof \Iterator) {
86
- return new \_PhpScoper5b6804f9734c8\GuzzleHttp\Psr7\PumpStream(function () use($resource) {
87
  if (!$resource->valid()) {
88
- return \false;
89
  }
90
  $result = $resource->current();
91
  $resource->next();
92
  return $result;
93
  }, $options);
94
- } elseif (\method_exists($resource, '__toString')) {
95
  return stream_for((string) $resource, $options);
96
  }
97
  break;
98
  case 'NULL':
99
- return new \_PhpScoper5b6804f9734c8\GuzzleHttp\Psr7\Stream(\fopen('php://temp', 'r+'), $options);
100
  }
101
- if (\is_callable($resource)) {
102
- return new \_PhpScoper5b6804f9734c8\GuzzleHttp\Psr7\PumpStream($resource, $options);
 
103
  }
104
- throw new \InvalidArgumentException('Invalid resource type: ' . \gettype($resource));
 
105
  }
 
106
  /**
107
  * Parse an array of header values containing ";" separated data into an
108
  * array of associative arrays representing the header key value pair
@@ -117,15 +130,16 @@ function parse_header($header)
117
  {
118
  static $trimmed = "\"' \n\t\r";
119
  $params = $matches = [];
 
120
  foreach (normalize_header($header) as $val) {
121
  $part = [];
122
- foreach (\preg_split('/;(?=([^"]*"[^"]*")*[^"]*$)/', $val) as $kvp) {
123
- if (\preg_match_all('/<[^>]+>|[^=]+/', $kvp, $matches)) {
124
  $m = $matches[0];
125
  if (isset($m[1])) {
126
- $part[\trim($m[0], $trimmed)] = \trim($m[1], $trimmed);
127
  } else {
128
- $part[] = \trim($m[0], $trimmed);
129
  }
130
  }
131
  }
@@ -133,8 +147,10 @@ function parse_header($header)
133
  $params[] = $part;
134
  }
135
  }
 
136
  return $params;
137
  }
 
138
  /**
139
  * Converts an array of header values that may contain comma separated
140
  * headers into an array of headers with no comma separated values.
@@ -145,23 +161,26 @@ function parse_header($header)
145
  */
146
  function normalize_header($header)
147
  {
148
- if (!\is_array($header)) {
149
- return \array_map('trim', \explode(',', $header));
150
  }
 
151
  $result = [];
152
  foreach ($header as $value) {
153
  foreach ((array) $value as $v) {
154
- if (\strpos($v, ',') === \false) {
155
  $result[] = $v;
156
  continue;
157
  }
158
- foreach (\preg_split('/,(?=([^"]*"[^"]*")*[^"]*$)/', $v) as $vv) {
159
- $result[] = \trim($vv);
160
  }
161
  }
162
  }
 
163
  return $result;
164
  }
 
165
  /**
166
  * Clone and modify a request with the given changes.
167
  *
@@ -179,43 +198,69 @@ function normalize_header($header)
179
  *
180
  * @return RequestInterface
181
  */
182
- function modify_request(\_PhpScoper5b6804f9734c8\Psr\Http\Message\RequestInterface $request, array $changes)
183
  {
184
  if (!$changes) {
185
  return $request;
186
  }
 
187
  $headers = $request->getHeaders();
 
188
  if (!isset($changes['uri'])) {
189
  $uri = $request->getUri();
190
  } else {
191
  // Remove the host header if one is on the URI
192
  if ($host = $changes['uri']->getHost()) {
193
  $changes['set_headers']['Host'] = $host;
 
194
  if ($port = $changes['uri']->getPort()) {
195
  $standardPorts = ['http' => 80, 'https' => 443];
196
  $scheme = $changes['uri']->getScheme();
197
  if (isset($standardPorts[$scheme]) && $port != $standardPorts[$scheme]) {
198
- $changes['set_headers']['Host'] .= ':' . $port;
199
  }
200
  }
201
  }
202
  $uri = $changes['uri'];
203
  }
 
204
  if (!empty($changes['remove_headers'])) {
205
  $headers = _caseless_remove($changes['remove_headers'], $headers);
206
  }
 
207
  if (!empty($changes['set_headers'])) {
208
- $headers = _caseless_remove(\array_keys($changes['set_headers']), $headers);
209
  $headers = $changes['set_headers'] + $headers;
210
  }
 
211
  if (isset($changes['query'])) {
212
  $uri = $uri->withQuery($changes['query']);
213
  }
214
- if ($request instanceof \_PhpScoper5b6804f9734c8\Psr\Http\Message\ServerRequestInterface) {
215
- return new \_PhpScoper5b6804f9734c8\GuzzleHttp\Psr7\ServerRequest(isset($changes['method']) ? $changes['method'] : $request->getMethod(), $uri, $headers, isset($changes['body']) ? $changes['body'] : $request->getBody(), isset($changes['version']) ? $changes['version'] : $request->getProtocolVersion(), $request->getServerParams());
 
 
 
 
 
 
 
 
 
 
216
  }
217
- return new \_PhpScoper5b6804f9734c8\GuzzleHttp\Psr7\Request(isset($changes['method']) ? $changes['method'] : $request->getMethod(), $uri, $headers, isset($changes['body']) ? $changes['body'] : $request->getBody(), isset($changes['version']) ? $changes['version'] : $request->getProtocolVersion());
 
 
 
 
 
 
 
 
 
218
  }
 
219
  /**
220
  * Attempts to rewind a message body and throws an exception on failure.
221
  *
@@ -226,13 +271,15 @@ function modify_request(\_PhpScoper5b6804f9734c8\Psr\Http\Message\RequestInterfa
226
  *
227
  * @throws \RuntimeException
228
  */
229
- function rewind_body(\_PhpScoper5b6804f9734c8\Psr\Http\Message\MessageInterface $message)
230
  {
231
  $body = $message->getBody();
 
232
  if ($body->tell()) {
233
  $body->rewind();
234
  }
235
  }
 
236
  /**
237
  * Safely opens a PHP stream resource using a filename.
238
  *
@@ -248,17 +295,26 @@ function rewind_body(\_PhpScoper5b6804f9734c8\Psr\Http\Message\MessageInterface
248
  function try_fopen($filename, $mode)
249
  {
250
  $ex = null;
251
- \set_error_handler(function () use($filename, $mode, &$ex) {
252
- $ex = new \RuntimeException(\sprintf('Unable to open %s using mode %s: %s', $filename, $mode, \func_get_args()[1]));
 
 
 
 
 
253
  });
254
- $handle = \fopen($filename, $mode);
255
- \restore_error_handler();
 
 
256
  if ($ex) {
257
  /** @var $ex \RuntimeException */
258
  throw $ex;
259
  }
 
260
  return $handle;
261
  }
 
262
  /**
263
  * Copy the contents of a stream into a string until the given number of
264
  * bytes have been read.
@@ -269,9 +325,10 @@ function try_fopen($filename, $mode)
269
  * @return string
270
  * @throws \RuntimeException on error.
271
  */
272
- function copy_to_string(\_PhpScoper5b6804f9734c8\Psr\Http\Message\StreamInterface $stream, $maxLen = -1)
273
  {
274
  $buffer = '';
 
275
  if ($maxLen === -1) {
276
  while (!$stream->eof()) {
277
  $buf = $stream->read(1048576);
@@ -283,6 +340,7 @@ function copy_to_string(\_PhpScoper5b6804f9734c8\Psr\Http\Message\StreamInterfac
283
  }
284
  return $buffer;
285
  }
 
286
  $len = 0;
287
  while (!$stream->eof() && $len < $maxLen) {
288
  $buf = $stream->read($maxLen - $len);
@@ -291,10 +349,12 @@ function copy_to_string(\_PhpScoper5b6804f9734c8\Psr\Http\Message\StreamInterfac
291
  break;
292
  }
293
  $buffer .= $buf;
294
- $len = \strlen($buffer);
295
  }
 
296
  return $buffer;
297
  }
 
298
  /**
299
  * Copy the contents of a stream into another stream until the given number
300
  * of bytes have been read.
@@ -306,9 +366,13 @@ function copy_to_string(\_PhpScoper5b6804f9734c8\Psr\Http\Message\StreamInterfac
306
  *
307
  * @throws \RuntimeException on error.
308
  */
309
- function copy_to_stream(\_PhpScoper5b6804f9734c8\Psr\Http\Message\StreamInterface $source, \_PhpScoper5b6804f9734c8\Psr\Http\Message\StreamInterface $dest, $maxLen = -1)
310
- {
 
 
 
311
  $bufferSize = 8192;
 
312
  if ($maxLen === -1) {
313
  while (!$source->eof()) {
314
  if (!$dest->write($source->read($bufferSize))) {
@@ -318,8 +382,8 @@ function copy_to_stream(\_PhpScoper5b6804f9734c8\Psr\Http\Message\StreamInterfac
318
  } else {
319
  $remaining = $maxLen;
320
  while ($remaining > 0 && !$source->eof()) {
321
- $buf = $source->read(\min($bufferSize, $remaining));
322
- $len = \strlen($buf);
323
  if (!$len) {
324
  break;
325
  }
@@ -328,6 +392,7 @@ function copy_to_stream(\_PhpScoper5b6804f9734c8\Psr\Http\Message\StreamInterfac
328
  }
329
  }
330
  }
 
331
  /**
332
  * Calculate a hash of a Stream
333
  *
@@ -338,20 +403,28 @@ function copy_to_stream(\_PhpScoper5b6804f9734c8\Psr\Http\Message\StreamInterfac
338
  * @return string Returns the hash of the stream
339
  * @throws \RuntimeException on error.
340
  */
341
- function hash(\_PhpScoper5b6804f9734c8\Psr\Http\Message\StreamInterface $stream, $algo, $rawOutput = \false)
342
- {
 
 
 
343
  $pos = $stream->tell();
 
344
  if ($pos > 0) {
345
  $stream->rewind();
346
  }
347
- $ctx = \hash_init($algo);
 
348
  while (!$stream->eof()) {
349
- \hash_update($ctx, $stream->read(1048576));
350
  }
351
- $out = \hash_final($ctx, (bool) $rawOutput);
 
352
  $stream->seek($pos);
 
353
  return $out;
354
  }
 
355
  /**
356
  * Read a line from the stream up to the maximum allowed buffer length
357
  *
@@ -360,10 +433,11 @@ function hash(\_PhpScoper5b6804f9734c8\Psr\Http\Message\StreamInterface $stream,
360
  *
361
  * @return string|bool
362
  */
363
- function readline(\_PhpScoper5b6804f9734c8\Psr\Http\Message\StreamInterface $stream, $maxLength = null)
364
  {
365
  $buffer = '';
366
  $size = 0;
 
367
  while (!$stream->eof()) {
368
  // Using a loose equality here to match on '' and false.
369
  if (null == ($byte = $stream->read(1))) {
@@ -375,8 +449,10 @@ function readline(\_PhpScoper5b6804f9734c8\Psr\Http\Message\StreamInterface $str
375
  break;
376
  }
377
  }
 
378
  return $buffer;
379
  }
 
380
  /**
381
  * Parses a request message string into a request object.
382
  *
@@ -388,14 +464,23 @@ function parse_request($message)
388
  {
389
  $data = _parse_message($message);
390
  $matches = [];
391
- if (!\preg_match('/^[\\S]+\\s+([a-zA-Z]+:\\/\\/|\\/).*/', $data['start-line'], $matches)) {
392
  throw new \InvalidArgumentException('Invalid request string');
393
  }
394
- $parts = \explode(' ', $data['start-line'], 3);
395
- $version = isset($parts[2]) ? \explode('/', $parts[2])[1] : '1.1';
396
- $request = new \_PhpScoper5b6804f9734c8\GuzzleHttp\Psr7\Request($parts[0], $matches[1] === '/' ? _parse_request_uri($parts[1], $data['headers']) : $parts[1], $data['headers'], $data['body'], $version);
 
 
 
 
 
 
 
 
397
  return $matches[1] === '/' ? $request : $request->withRequestTarget($parts[1]);
398
  }
 
399
  /**
400
  * Parses a response message string into a response object.
401
  *
@@ -409,12 +494,20 @@ function parse_response($message)
409
  // According to https://tools.ietf.org/html/rfc7230#section-3.1.2 the space
410
  // between status-code and reason-phrase is required. But browsers accept
411
  // responses without space and reason as well.
412
- if (!\preg_match('/^HTTP\\/.* [0-9]{3}( .*|$)/', $data['start-line'])) {
413
  throw new \InvalidArgumentException('Invalid response string');
414
  }
415
- $parts = \explode(' ', $data['start-line'], 3);
416
- return new \_PhpScoper5b6804f9734c8\GuzzleHttp\Psr7\Response($parts[1], $data['headers'], $data['body'], \explode('/', $parts[0])[1], isset($parts[2]) ? $parts[2] : null);
 
 
 
 
 
 
 
417
  }
 
418
  /**
419
  * Parse a query string into an associative array.
420
  *
@@ -428,40 +521,43 @@ function parse_response($message)
428
  *
429
  * @return array
430
  */
431
- function parse_query($str, $urlEncoding = \true)
432
  {
433
  $result = [];
 
434
  if ($str === '') {
435
  return $result;
436
  }
437
- if ($urlEncoding === \true) {
 
438
  $decoder = function ($value) {
439
- return \rawurldecode(\str_replace('+', ' ', $value));
440
  };
441
- } elseif ($urlEncoding == \PHP_QUERY_RFC3986) {
442
  $decoder = 'rawurldecode';
443
- } elseif ($urlEncoding == \PHP_QUERY_RFC1738) {
444
  $decoder = 'urldecode';
445
  } else {
446
- $decoder = function ($str) {
447
- return $str;
448
- };
449
  }
450
- foreach (\explode('&', $str) as $kvp) {
451
- $parts = \explode('=', $kvp, 2);
 
452
  $key = $decoder($parts[0]);
453
  $value = isset($parts[1]) ? $decoder($parts[1]) : null;
454
  if (!isset($result[$key])) {
455
  $result[$key] = $value;
456
  } else {
457
- if (!\is_array($result[$key])) {
458
  $result[$key] = [$result[$key]];
459
  }
460
  $result[$key][] = $value;
461
  }
462
  }
 
463
  return $result;
464
  }
 
465
  /**
466
  * Build a query string from an array of key value pairs.
467
  *
@@ -475,26 +571,26 @@ function parse_query($str, $urlEncoding = \true)
475
  * to encode using RFC1738.
476
  * @return string
477
  */
478
- function build_query(array $params, $encoding = \PHP_QUERY_RFC3986)
479
  {
480
  if (!$params) {
481
  return '';
482
  }
483
- if ($encoding === \false) {
484
- $encoder = function ($str) {
485
- return $str;
486
- };
487
- } elseif ($encoding === \PHP_QUERY_RFC3986) {
488
  $encoder = 'rawurlencode';
489
- } elseif ($encoding === \PHP_QUERY_RFC1738) {
490
  $encoder = 'urlencode';
491
  } else {
492
  throw new \InvalidArgumentException('Invalid type');
493
  }
 
494
  $qs = '';
495
  foreach ($params as $k => $v) {
496
  $k = $encoder($k);
497
- if (!\is_array($v)) {
498
  $qs .= $k;
499
  if ($v !== null) {
500
  $qs .= '=' . $encoder($v);
@@ -510,8 +606,10 @@ function build_query(array $params, $encoding = \PHP_QUERY_RFC3986)
510
  }
511
  }
512
  }
513
- return $qs ? (string) \substr($qs, 0, -1) : '';
 
514
  }
 
515
  /**
516
  * Determines the mimetype of a file by looking at its extension.
517
  *
@@ -521,8 +619,9 @@ function build_query(array $params, $encoding = \PHP_QUERY_RFC3986)
521
  */
522
  function mimetype_from_filename($filename)
523
  {
524
- return mimetype_from_extension(\pathinfo($filename, \PATHINFO_EXTENSION));
525
  }
 
526
  /**
527
  * Maps a file extensions to a mimetype.
528
  *
@@ -533,10 +632,114 @@ function mimetype_from_filename($filename)
533
  */
534
  function mimetype_from_extension($extension)
535
  {
536
- static $mimetypes = ['7z' => 'application/x-7z-compressed', 'aac' => 'audio/x-aac', 'ai' => 'application/postscript', 'aif' => 'audio/x-aiff', 'asc' => 'text/plain', 'asf' => 'video/x-ms-asf', 'atom' => 'application/atom+xml', 'avi' => 'video/x-msvideo', 'bmp' => 'image/bmp', 'bz2' => 'application/x-bzip2', 'cer' => 'application/pkix-cert', 'crl' => 'application/pkix-crl', 'crt' => 'application/x-x509-ca-cert', 'css' => 'text/css', 'csv' => 'text/csv', 'cu' => 'application/cu-seeme', 'deb' => 'application/x-debian-package', 'doc' => 'application/msword', 'docx' => 'application/vnd.openxmlformats-officedocument.wordprocessingml.document', 'dvi' => 'application/x-dvi', 'eot' => 'application/vnd.ms-fontobject', 'eps' => 'application/postscript', 'epub' => 'application/epub+zip', 'etx' => 'text/x-setext', 'flac' => 'audio/flac', 'flv' => 'video/x-flv', 'gif' => 'image/gif', 'gz' => 'application/gzip', 'htm' => 'text/html', 'html' => 'text/html', 'ico' => 'image/x-icon', 'ics' => 'text/calendar', 'ini' => 'text/plain', 'iso' => 'application/x-iso9660-image', 'jar' => 'application/java-archive', 'jpe' => 'image/jpeg', 'jpeg' => 'image/jpeg', 'jpg' => 'image/jpeg', 'js' => 'text/javascript', 'json' => 'application/json', 'latex' => 'application/x-latex', 'log' => 'text/plain', 'm4a' => 'audio/mp4', 'm4v' => 'video/mp4', 'mid' => 'audio/midi', 'midi' => 'audio/midi', 'mov' => 'video/quicktime', 'mp3' => 'audio/mpeg', 'mp4' => 'video/mp4', 'mp4a' => 'audio/mp4', 'mp4v' => 'video/mp4', 'mpe' => 'video/mpeg', 'mpeg' => 'video/mpeg', 'mpg' => 'video/mpeg', 'mpg4' => 'video/mp4', 'oga' => 'audio/ogg', 'ogg' => 'audio/ogg', 'ogv' => 'video/ogg', 'ogx' => 'application/ogg', 'pbm' => 'image/x-portable-bitmap', 'pdf' => 'application/pdf', 'pgm' => 'image/x-portable-graymap', 'png' => 'image/png', 'pnm' => 'image/x-portable-anymap', 'ppm' => 'image/x-portable-pixmap', 'ppt' => 'application/vnd.ms-powerpoint', 'pptx' => 'application/vnd.openxmlformats-officedocument.presentationml.presentation', 'ps' => 'application/postscript', 'qt' => 'video/quicktime', 'rar' => 'application/x-rar-compressed', 'ras' => 'image/x-cmu-raster', 'rss' => 'application/rss+xml', 'rtf' => 'application/rtf', 'sgm' => 'text/sgml', 'sgml' => 'text/sgml', 'svg' => 'image/svg+xml', 'swf' => 'application/x-shockwave-flash', 'tar' => 'application/x-tar', 'tif' => 'image/tiff', 'tiff' => 'image/tiff', 'torrent' => 'application/x-bittorrent', 'ttf' => 'application/x-font-ttf', 'txt' => 'text/plain', 'wav' => 'audio/x-wav', 'webm' => 'video/webm', 'wma' => 'audio/x-ms-wma', 'wmv' => 'video/x-ms-wmv', 'woff' => 'application/x-font-woff', 'wsdl' => 'application/wsdl+xml', 'xbm' => 'image/x-xbitmap', 'xls' => 'application/vnd.ms-excel', 'xlsx' => 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet', 'xml' => 'application/xml', 'xpm' => 'image/x-xpixmap', 'xwd' => 'image/x-xwindowdump', 'yaml' => 'text/yaml', 'yml' => 'text/yaml', 'zip' => 'application/zip'];
537
- $extension = \strtolower($extension);
538
- return isset($mimetypes[$extension]) ? $mimetypes[$extension] : null;
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
539
  }
 
540
  /**
541
  * Parses an HTTP message into an associative array.
542
  *
@@ -554,28 +757,32 @@ function _parse_message($message)
554
  if (!$message) {
555
  throw new \InvalidArgumentException('Invalid message');
556
  }
 
557
  // Iterate over each line in the message, accounting for line endings
558
- $lines = \preg_split('/(\\r?\\n)/', $message, -1, \PREG_SPLIT_DELIM_CAPTURE);
559
- $result = ['start-line' => \array_shift($lines), 'headers' => [], 'body' => ''];
560
- \array_shift($lines);
561
- for ($i = 0, $totalLines = \count($lines); $i < $totalLines; $i += 2) {
 
562
  $line = $lines[$i];
563
  // If two line breaks were encountered, then this is the end of body
564
  if (empty($line)) {
565
  if ($i < $totalLines - 1) {
566
- $result['body'] = \implode('', \array_slice($lines, $i + 2));
567
  }
568
  break;
569
  }
570
- if (\strpos($line, ':')) {
571
- $parts = \explode(':', $line, 2);
572
- $key = \trim($parts[0]);
573
- $value = isset($parts[1]) ? \trim($parts[1]) : '';
574
  $result['headers'][$key][] = $value;
575
  }
576
  }
 
577
  return $result;
578
  }
 
579
  /**
580
  * Constructs a URI for an HTTP request message.
581
  *
@@ -587,28 +794,35 @@ function _parse_message($message)
587
  */
588
  function _parse_request_uri($path, array $headers)
589
  {
590
- $hostKey = \array_filter(\array_keys($headers), function ($k) {
591
- return \strtolower($k) === 'host';
592
  });
 
593
  // If no host is found, then a full URI cannot be constructed.
594
  if (!$hostKey) {
595
  return $path;
596
  }
597
- $host = $headers[\reset($hostKey)][0];
598
- $scheme = \substr($host, -4) === ':443' ? 'https' : 'http';
599
- return $scheme . '://' . $host . '/' . \ltrim($path, '/');
 
 
600
  }
 
601
  /** @internal */
602
  function _caseless_remove($keys, array $data)
603
  {
604
  $result = [];
 
605
  foreach ($keys as &$key) {
606
- $key = \strtolower($key);
607
  }
 
608
  foreach ($data as $k => $v) {
609
- if (!\in_array(\strtolower($k), $keys)) {
610
  $result[$k] = $v;
611
  }
612
  }
 
613
  return $result;
614
  }
1
  <?php
2
+ namespace GuzzleHttp\Psr7;
3
 
4
+ use Psr\Http\Message\MessageInterface;
5
+ use Psr\Http\Message\RequestInterface;
6
+ use Psr\Http\Message\ResponseInterface;
7
+ use Psr\Http\Message\ServerRequestInterface;
8
+ use Psr\Http\Message\StreamInterface;
9
+ use Psr\Http\Message\UriInterface;
10
 
 
 
 
 
 
 
11
  /**
12
  * Returns the string representation of an HTTP message.
13
  *
15
  *
16
  * @return string
17
  */
18
+ function str(MessageInterface $message)
19
  {
20
+ if ($message instanceof RequestInterface) {
21
+ $msg = trim($message->getMethod() . ' '
22
+ . $message->getRequestTarget())
23
+ . ' HTTP/' . $message->getProtocolVersion();
24
  if (!$message->hasHeader('host')) {
25
  $msg .= "\r\nHost: " . $message->getUri()->getHost();
26
  }
27
+ } elseif ($message instanceof ResponseInterface) {
28
+ $msg = 'HTTP/' . $message->getProtocolVersion() . ' '
29
+ . $message->getStatusCode() . ' '
30
+ . $message->getReasonPhrase();
31
  } else {
32
  throw new \InvalidArgumentException('Unknown message type');
33
  }
34
+
35
  foreach ($message->getHeaders() as $name => $values) {
36
+ $msg .= "\r\n{$name}: " . implode(', ', $values);
37
  }
38
+
39
  return "{$msg}\r\n\r\n" . $message->getBody();
40
  }
41
+
42
  /**
43
  * Returns a UriInterface for the given value.
44
  *
53
  */
54
  function uri_for($uri)
55
  {
56
+ if ($uri instanceof UriInterface) {
57
  return $uri;
58
+ } elseif (is_string($uri)) {
59
+ return new Uri($uri);
60
  }
61
+
62
  throw new \InvalidArgumentException('URI must be a string or UriInterface');
63
  }
64
+
65
  /**
66
  * Create a new stream based on the input type.
67
  *
77
  */
78
  function stream_for($resource = '', array $options = [])
79
  {
80
+ if (is_scalar($resource)) {
81
+ $stream = fopen('php://temp', 'r+');
82
  if ($resource !== '') {
83
+ fwrite($stream, $resource);
84
+ fseek($stream, 0);
85
  }
86
+ return new Stream($stream, $options);
87
  }
88
+
89
+ switch (gettype($resource)) {
90
  case 'resource':
91
+ return new Stream($resource, $options);
92
  case 'object':
93
+ if ($resource instanceof StreamInterface) {
94
  return $resource;
95
  } elseif ($resource instanceof \Iterator) {
96
+ return new PumpStream(function () use ($resource) {
97
  if (!$resource->valid()) {
98
+ return false;
99
  }
100
  $result = $resource->current();
101
  $resource->next();
102
  return $result;
103
  }, $options);
104
+ } elseif (method_exists($resource, '__toString')) {
105
  return stream_for((string) $resource, $options);
106
  }
107
  break;
108
  case 'NULL':
109
+ return new Stream(fopen('php://temp', 'r+'), $options);
110
  }
111
+
112
+ if (is_callable($resource)) {
113
+ return new PumpStream($resource, $options);
114
  }
115
+
116
+ throw new \InvalidArgumentException('Invalid resource type: ' . gettype($resource));
117
  }
118
+
119
  /**
120
  * Parse an array of header values containing ";" separated data into an
121
  * array of associative arrays representing the header key value pair
130
  {
131
  static $trimmed = "\"' \n\t\r";
132
  $params = $matches = [];
133
+
134
  foreach (normalize_header($header) as $val) {
135
  $part = [];
136
+ foreach (preg_split('/;(?=([^"]*"[^"]*")*[^"]*$)/', $val) as $kvp) {
137
+ if (preg_match_all('/<[^>]+>|[^=]+/', $kvp, $matches)) {
138
  $m = $matches[0];
139
  if (isset($m[1])) {
140
+ $part[trim($m[0], $trimmed)] = trim($m[1], $trimmed);
141
  } else {
142
+ $part[] = trim($m[0], $trimmed);
143
  }
144
  }
145
  }
147
  $params[] = $part;
148
  }
149
  }
150
+
151
  return $params;
152
  }
153
+
154
  /**
155
  * Converts an array of header values that may contain comma separated
156
  * headers into an array of headers with no comma separated values.
161
  */
162
  function normalize_header($header)
163
  {
164
+ if (!is_array($header)) {
165
+ return array_map('trim', explode(',', $header));
166
  }
167
+
168
  $result = [];
169
  foreach ($header as $value) {
170
  foreach ((array) $value as $v) {
171
+ if (strpos($v, ',') === false) {
172
  $result[] = $v;
173
  continue;
174
  }
175
+ foreach (preg_split('/,(?=([^"]*"[^"]*")*[^"]*$)/', $v) as $vv) {
176
+ $result[] = trim($vv);
177
  }
178
  }
179
  }
180
+
181
  return $result;
182
  }
183
+
184
  /**
185
  * Clone and modify a request with the given changes.
186
  *
198
  *
199
  * @return RequestInterface
200
  */
201
+ function modify_request(RequestInterface $request, array $changes)
202
  {
203
  if (!$changes) {
204
  return $request;
205
  }
206
+
207
  $headers = $request->getHeaders();
208
+
209
  if (!isset($changes['uri'])) {
210
  $uri = $request->getUri();
211
  } else {
212
  // Remove the host header if one is on the URI
213
  if ($host = $changes['uri']->getHost()) {
214
  $changes['set_headers']['Host'] = $host;
215
+
216
  if ($port = $changes['uri']->getPort()) {
217
  $standardPorts = ['http' => 80, 'https' => 443];
218
  $scheme = $changes['uri']->getScheme();
219
  if (isset($standardPorts[$scheme]) && $port != $standardPorts[$scheme]) {
220
+ $changes['set_headers']['Host'] .= ':'.$port;
221
  }
222
  }
223
  }
224
  $uri = $changes['uri'];
225
  }
226
+
227
  if (!empty($changes['remove_headers'])) {
228
  $headers = _caseless_remove($changes['remove_headers'], $headers);
229
  }
230
+
231
  if (!empty($changes['set_headers'])) {
232
+ $headers = _caseless_remove(array_keys($changes['set_headers']), $headers);
233
  $headers = $changes['set_headers'] + $headers;
234
  }
235
+
236
  if (isset($changes['query'])) {
237
  $uri = $uri->withQuery($changes['query']);
238
  }
239
+
240
+ if ($request instanceof ServerRequestInterface) {
241
+ return new ServerRequest(
242
+ isset($changes['method']) ? $changes['method'] : $request->getMethod(),
243
+ $uri,
244
+ $headers,
245
+ isset($changes['body']) ? $changes['body'] : $request->getBody(),
246
+ isset($changes['version'])
247
+ ? $changes['version']
248
+ : $request->getProtocolVersion(),
249
+ $request->getServerParams()
250
+ );
251
  }
252
+
253
+ return new Request(
254
+ isset($changes['method']) ? $changes['method'] : $request->getMethod(),
255
+ $uri,
256
+ $headers,
257
+ isset($changes['body']) ? $changes['body'] : $request->getBody(),
258
+ isset($changes['version'])
259
+ ? $changes['version']
260
+ : $request->getProtocolVersion()
261
+ );
262
  }
263
+
264
  /**
265
  * Attempts to rewind a message body and throws an exception on failure.
266
  *
271
  *
272
  * @throws \RuntimeException
273
  */
274
+ function rewind_body(MessageInterface $message)
275
  {
276
  $body = $message->getBody();
277
+
278
  if ($body->tell()) {
279
  $body->rewind();
280
  }
281
  }
282
+
283
  /**
284
  * Safely opens a PHP stream resource using a filename.
285
  *
295
  function try_fopen($filename, $mode)
296
  {
297
  $ex = null;
298
+ set_error_handler(function () use ($filename, $mode, &$ex) {
299
+ $ex = new \RuntimeException(sprintf(
300
+ 'Unable to open %s using mode %s: %s',
301
+ $filename,
302
+ $mode,
303
+ func_get_args()[1]
304
+ ));
305
  });
306
+
307
+ $handle = fopen($filename, $mode);
308
+ restore_error_handler();
309
+
310
  if ($ex) {
311
  /** @var $ex \RuntimeException */
312
  throw $ex;
313
  }
314
+
315
  return $handle;
316
  }
317
+
318
  /**
319
  * Copy the contents of a stream into a string until the given number of
320
  * bytes have been read.
325
  * @return string
326
  * @throws \RuntimeException on error.
327
  */
328
+ function copy_to_string(StreamInterface $stream, $maxLen = -1)
329
  {
330
  $buffer = '';
331
+
332
  if ($maxLen === -1) {
333
  while (!$stream->eof()) {
334
  $buf = $stream->read(1048576);
340
  }
341
  return $buffer;
342
  }
343
+
344
  $len = 0;
345
  while (!$stream->eof() && $len < $maxLen) {
346
  $buf = $stream->read($maxLen - $len);
349
  break;
350
  }
351
  $buffer .= $buf;
352
+ $len = strlen($buffer);
353
  }
354
+
355
  return $buffer;
356
  }
357
+
358
  /**
359
  * Copy the contents of a stream into another stream until the given number
360
  * of bytes have been read.
366
  *
367
  * @throws \RuntimeException on error.
368
  */
369
+ function copy_to_stream(
370
+ StreamInterface $source,
371
+ StreamInterface $dest,
372
+ $maxLen = -1
373
+ ) {
374
  $bufferSize = 8192;
375
+
376
  if ($maxLen === -1) {
377
  while (!$source->eof()) {
378
  if (!$dest->write($source->read($bufferSize))) {
382
  } else {
383
  $remaining = $maxLen;
384
  while ($remaining > 0 && !$source->eof()) {
385
+ $buf = $source->read(min($bufferSize, $remaining));
386
+ $len = strlen($buf);
387
  if (!$len) {
388
  break;
389
  }
392
  }
393
  }
394
  }
395
+
396
  /**
397
  * Calculate a hash of a Stream
398
  *
403
  * @return string Returns the hash of the stream
404
  * @throws \RuntimeException on error.
405
  */
406
+ function hash(
407
+ StreamInterface $stream,
408
+ $algo,
409
+ $rawOutput = false
410
+ ) {
411
  $pos = $stream->tell();
412
+
413
  if ($pos > 0) {
414
  $stream->rewind();
415
  }
416
+
417
+ $ctx = hash_init($algo);
418
  while (!$stream->eof()) {
419
+ hash_update($ctx, $stream->read(1048576));
420
  }
421
+
422
+ $out = hash_final($ctx, (bool) $rawOutput);
423
  $stream->seek($pos);
424
+
425
  return $out;
426
  }
427
+
428
  /**
429
  * Read a line from the stream up to the maximum allowed buffer length
430
  *
433
  *
434
  * @return string|bool
435
  */
436
+ function readline(StreamInterface $stream, $maxLength = null)
437
  {
438
  $buffer = '';
439
  $size = 0;
440
+
441
  while (!$stream->eof()) {
442
  // Using a loose equality here to match on '' and false.
443
  if (null == ($byte = $stream->read(1))) {
449
  break;
450
  }
451
  }
452
+
453
  return $buffer;
454
  }
455
+
456
  /**
457
  * Parses a request message string into a request object.
458
  *
464
  {
465
  $data = _parse_message($message);
466
  $matches = [];
467
+ if (!preg_match('/^[\S]+\s+([a-zA-Z]+:\/\/|\/).*/', $data['start-line'], $matches)) {
468
  throw new \InvalidArgumentException('Invalid request string');
469
  }
470
+ $parts = explode(' ', $data['start-line'], 3);
471
+ $version = isset($parts[2]) ? explode('/', $parts[2])[1] : '1.1';
472
+
473
+ $request = new Request(
474
+ $parts[0],
475
+ $matches[1] === '/' ? _parse_request_uri($parts[1], $data['headers']) : $parts[1],
476
+ $data['headers'],
477
+ $data['body'],
478
+ $version
479
+ );
480
+
481
  return $matches[1] === '/' ? $request : $request->withRequestTarget($parts[1]);
482
  }
483
+
484
  /**
485
  * Parses a response message string into a response object.
486
  *
494
  // According to https://tools.ietf.org/html/rfc7230#section-3.1.2 the space
495
  // between status-code and reason-phrase is required. But browsers accept
496
  // responses without space and reason as well.
497
+ if (!preg_match('/^HTTP\/.* [0-9]{3}( .*|$)/', $data['start-line'])) {
498
  throw new \InvalidArgumentException('Invalid response string');
499
  }
500
+ $parts = explode(' ', $data['start-line'], 3);
501
+
502
+ return new Response(
503
+ $parts[1],
504
+ $data['headers'],
505
+ $data['body'],
506
+ explode('/', $parts[0])[1],
507
+ isset($parts[2]) ? $parts[2] : null
508
+ );
509
  }
510
+
511
  /**
512
  * Parse a query string into an associative array.
513
  *
521
  *
522
  * @return array
523
  */
524
+ function parse_query($str, $urlEncoding = true)
525
  {
526
  $result = [];
527
+
528
  if ($str === '') {
529
  return $result;
530
  }
531
+
532
+ if ($urlEncoding === true) {
533
  $decoder = function ($value) {
534
+ return rawurldecode(str_replace('+', ' ', $value));
535
  };
536
+ } elseif ($urlEncoding == PHP_QUERY_RFC3986) {
537
  $decoder = 'rawurldecode';
538
+ } elseif ($urlEncoding == PHP_QUERY_RFC1738) {
539
  $decoder = 'urldecode';
540
  } else {
541
+ $decoder = function ($str) { return $str; };
 
 
542
  }
543
+
544
+ foreach (explode('&', $str) as $kvp) {
545
+ $parts = explode('=', $kvp, 2);
546
  $key = $decoder($parts[0]);
547
  $value = isset($parts[1]) ? $decoder($parts[1]) : null;
548
  if (!isset($result[$key])) {
549
  $result[$key] = $value;
550
  } else {
551
+ if (!is_array($result[$key])) {
552
  $result[$key] = [$result[$key]];
553
  }
554
  $result[$key][] = $value;
555
  }
556
  }
557
+
558
  return $result;
559
  }
560
+
561
  /**
562
  * Build a query string from an array of key value pairs.
563
  *
571
  * to encode using RFC1738.
572
  * @return string
573
  */
574
+ function build_query(array $params, $encoding = PHP_QUERY_RFC3986)
575
  {
576
  if (!$params) {
577
  return '';
578
  }
579
+
580
+ if ($encoding === false) {
581
+ $encoder = function ($str) { return $str; };
582
+ } elseif ($encoding === PHP_QUERY_RFC3986) {
 
583
  $encoder = 'rawurlencode';
584
+ } elseif ($encoding === PHP_QUERY_RFC1738) {
585
  $encoder = 'urlencode';
586
  } else {
587
  throw new \InvalidArgumentException('Invalid type');
588
  }
589
+
590
  $qs = '';
591
  foreach ($params as $k => $v) {
592
  $k = $encoder($k);
593
+ if (!is_array($v)) {
594
  $qs .= $k;
595
  if ($v !== null) {
596
  $qs .= '=' . $encoder($v);
606
  }
607
  }
608
  }
609
+
610
+ return $qs ? (string) substr($qs, 0, -1) : '';
611
  }
612
+
613
  /**
614
  * Determines the mimetype of a file by looking at its extension.
615
  *
619
  */
620
  function mimetype_from_filename($filename)
621
  {
622
+ return mimetype_from_extension(pathinfo($filename, PATHINFO_EXTENSION));
623
  }
624
+
625
  /**
626
  * Maps a file extensions to a mimetype.
627
  *
632
  */
633
  function mimetype_from_extension($extension)
634
  {
635
+ static $mimetypes = [
636
+ '7z' => 'application/x-7z-compressed',
637
+ 'aac' => 'audio/x-aac',
638
+ 'ai' => 'application/postscript',
639
+ 'aif' => 'audio/x-aiff',
640
+ 'asc' => 'text/plain',
641
+ 'asf' => 'video/x-ms-asf',
642
+ 'atom' => 'application/atom+xml',
643
+ 'avi' => 'video/x-msvideo',
644
+ 'bmp' => 'image/bmp',
645
+ 'bz2' => 'application/x-bzip2',
646
+ 'cer' => 'application/pkix-cert',
647
+ 'crl' => 'application/pkix-crl',
648
+ 'crt' => 'application/x-x509-ca-cert',
649
+ 'css' => 'text/css',
650
+ 'csv' => 'text/csv',
651
+ 'cu' => 'application/cu-seeme',
652
+ 'deb' => 'application/x-debian-package',
653
+ 'doc' => 'application/msword',
654
+ 'docx' => 'application/vnd.openxmlformats-officedocument.wordprocessingml.document',
655
+ 'dvi' => 'application/x-dvi',
656
+ 'eot' => 'application/vnd.ms-fontobject',
657
+ 'eps' => 'application/postscript',
658
+ 'epub' => 'application/epub+zip',
659
+ 'etx' => 'text/x-setext',
660
+ 'flac' => 'audio/flac',
661
+ 'flv' => 'video/x-flv',
662
+ 'gif' => 'image/gif',
663
+ 'gz' => 'application/gzip',
664
+ 'htm' => 'text/html',
665
+ 'html' => 'text/html',
666
+ 'ico' => 'image/x-icon',
667
+ 'ics' => 'text/calendar',
668
+ 'ini' => 'text/plain',
669
+ 'iso' => 'application/x-iso9660-image',
670
+ 'jar' => 'application/java-archive',
671
+ 'jpe' => 'image/jpeg',
672
+ 'jpeg' => 'image/jpeg',
673
+ 'jpg' => 'image/jpeg',
674
+ 'js' => 'text/javascript',
675
+ 'json' => 'application/json',
676
+ 'latex' => 'application/x-latex',
677
+ 'log' => 'text/plain',
678
+ 'm4a' => 'audio/mp4',
679
+ 'm4v' => 'video/mp4',
680
+ 'mid' => 'audio/midi',
681
+ 'midi' => 'audio/midi',
682
+ 'mov' => 'video/quicktime',
683
+ 'mp3' => 'audio/mpeg',
684
+ 'mp4' => 'video/mp4',
685
+ 'mp4a' => 'audio/mp4',
686
+ 'mp4v' => 'video/mp4',
687
+ 'mpe' => 'video/mpeg',
688
+ 'mpeg' => 'video/mpeg',
689
+ 'mpg' => 'video/mpeg',
690
+ 'mpg4' => 'video/mp4',
691
+ 'oga' => 'audio/ogg',
692
+ 'ogg' => 'audio/ogg',
693
+ 'ogv' => 'video/ogg',
694
+ 'ogx' => 'application/ogg',
695
+ 'pbm' => 'image/x-portable-bitmap',
696
+ 'pdf' => 'application/pdf',
697
+ 'pgm' => 'image/x-portable-graymap',
698
+ 'png' => 'image/png',
699
+ 'pnm' => 'image/x-portable-anymap',
700
+ 'ppm' => 'image/x-portable-pixmap',
701
+ 'ppt' => 'application/vnd.ms-powerpoint',
702
+ 'pptx' => 'application/vnd.openxmlformats-officedocument.presentationml.presentation',
703
+ 'ps' => 'application/postscript',
704
+ 'qt' => 'video/quicktime',
705
+ 'rar' => 'application/x-rar-compressed',
706
+ 'ras' => 'image/x-cmu-raster',
707
+ 'rss' => 'application/rss+xml',
708
+ 'rtf' => 'application/rtf',
709
+ 'sgm' => 'text/sgml',
710
+ 'sgml' => 'text/sgml',
711
+ 'svg' => 'image/svg+xml',
712
+ 'swf' => 'application/x-shockwave-flash',
713
+ 'tar' => 'application/x-tar',
714
+ 'tif' => 'image/tiff',
715
+ 'tiff' => 'image/tiff',
716
+ 'torrent' => 'application/x-bittorrent',
717
+ 'ttf' => 'application/x-font-ttf',
718
+ 'txt' => 'text/plain',
719
+ 'wav' => 'audio/x-wav',
720
+ 'webm' => 'video/webm',
721
+ 'wma' => 'audio/x-ms-wma',
722
+ 'wmv' => 'video/x-ms-wmv',
723
+ 'woff' => 'application/x-font-woff',
724
+ 'wsdl' => 'application/wsdl+xml',
725
+ 'xbm' => 'image/x-xbitmap',
726
+ 'xls' => 'application/vnd.ms-excel',
727
+ 'xlsx' => 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet',
728
+ 'xml' => 'application/xml',
729
+ 'xpm' => 'image/x-xpixmap',
730
+ 'xwd' => 'image/x-xwindowdump',
731
+ 'yaml' => 'text/yaml',
732
+ 'yml' => 'text/yaml',
733
+ 'zip' => 'application/zip',
734
+ ];
735
+
736
+ $extension = strtolower($extension);
737
+
738
+ return isset($mimetypes[$extension])
739
+ ? $mimetypes[$extension]
740
+ : null;
741
  }
742
+
743
  /**
744
  * Parses an HTTP message into an associative array.
745
  *
757
  if (!$message) {
758
  throw new \InvalidArgumentException('Invalid message');
759
  }
760
+
761
  // Iterate over each line in the message, accounting for line endings
762
+ $lines = preg_split('/(\\r?\\n)/', $message, -1, PREG_SPLIT_DELIM_CAPTURE);
763
+ $result = ['start-line' => array_shift($lines), 'headers' => [], 'body' => ''];
764
+ array_shift($lines);
765
+
766
+ for ($i = 0, $totalLines = count($lines); $i < $totalLines; $i += 2) {
767
  $line = $lines[$i];
768
  // If two line breaks were encountered, then this is the end of body
769
  if (empty($line)) {
770
  if ($i < $totalLines - 1) {
771
+ $result['body'] = implode('', array_slice($lines, $i + 2));
772
  }
773
  break;
774
  }
775
+ if (strpos($line, ':')) {
776
+ $parts = explode(':', $line, 2);
777
+ $key = trim($parts[0]);
778
+ $value = isset($parts[1]) ? trim($parts[1]) : '';
779
  $result['headers'][$key][] = $value;
780
  }
781
  }
782
+
783
  return $result;
784
  }
785
+
786
  /**
787
  * Constructs a URI for an HTTP request message.
788
  *
794
  */
795
  function _parse_request_uri($path, array $headers)
796
  {
797
+ $hostKey = array_filter(array_keys($headers), function ($k) {
798
+ return strtolower($k) === 'host';
799
  });
800
+
801
  // If no host is found, then a full URI cannot be constructed.
802
  if (!$hostKey) {
803
  return $path;
804
  }
805
+
806
+ $host = $headers[reset($hostKey)][0];
807
+ $scheme = substr($host, -4) === ':443' ? 'https' : 'http';
808
+
809
+ return $scheme . '://' . $host . '/' . ltrim($path, '/');
810
  }
811
+
812
  /** @internal */
813
  function _caseless_remove($keys, array $data)
814
  {
815
  $result = [];
816
+
817
  foreach ($keys as &$key) {
818
+ $key = strtolower($key);
819
  }
820
+
821
  foreach ($data as $k => $v) {
822
+ if (!in_array(strtolower($k), $keys)) {
823
  $result[$k] = $v;
824
  }
825
  }
826
+
827
  return $result;
828
  }
includes/mollie-api-php/vendor/guzzlehttp/psr7/src/functions_include.php CHANGED
@@ -1,8 +1,6 @@
1
  <?php
2
 
3
- namespace _PhpScoper5b6804f9734c8;
4
-
5
  // Don't redefine the functions if included multiple times.
6
- if (!\function_exists('GuzzleHttp\\Psr7\\str')) {
7
  require __DIR__ . '/functions.php';
8
  }
1
  <?php
2
 
 
 
3
  // Don't redefine the functions if included multiple times.
4
+ if (!function_exists('GuzzleHttp\Psr7\str')) {
5
  require __DIR__ . '/functions.php';
6
  }
includes/mollie-api-php/vendor/psr/http-message/composer.json CHANGED
@@ -1,20 +1,13 @@
1
  {
2
- "name": "psr\/http-message",
3
  "description": "Common interface for HTTP messages",
4
- "keywords": [
5
- "psr",
6
- "psr-7",
7
- "http",
8
- "http-message",
9
- "request",
10
- "response"
11
- ],
12
- "homepage": "https:\/\/github.com\/php-fig\/http-message",
13
  "license": "MIT",
14
  "authors": [
15
  {
16
  "name": "PHP-FIG",
17
- "homepage": "http:\/\/www.php-fig.org\/"
18
  }
19
  ],
20
  "require": {
@@ -22,7 +15,7 @@
22
  },
23
  "autoload": {
24
  "psr-4": {
25
- "_PhpScoper5b6804f9734c8\\Psr\\Http\\Message\\": "src\/"
26
  }
27
  },
28
  "extra": {
@@ -30,4 +23,4 @@
30
  "dev-master": "1.0.x-dev"
31
  }
32
  }
33
- }
1
  {
2
+ "name": "psr/http-message",
3
  "description": "Common interface for HTTP messages",
4
+ "keywords": ["psr", "psr-7", "http", "http-message", "request", "response"],
5
+ "homepage": "https://github.com/php-fig/http-message",
 
 
 
 
 
 
 
6
  "license": "MIT",
7
  "authors": [
8
  {
9
  "name": "PHP-FIG",
10
+ "homepage": "http://www.php-fig.org/"
11
  }
12
  ],
13
  "require": {
15
  },
16
  "autoload": {
17
  "psr-4": {
18
+ "Psr\\Http\\Message\\": "src/"
19
  }
20
  },
21
  "extra": {
23
  "dev-master": "1.0.x-dev"
24
  }
25
  }
26
+ }
includes/mollie-api-php/vendor/psr/http-message/src/MessageInterface.php CHANGED
@@ -1,6 +1,6 @@
1
  <?php
2
 
3
- namespace _PhpScoper5b6804f9734c8\Psr\Http\Message;
4
 
5
  /**
6
  * HTTP messages consist of requests from a client to a server and responses
@@ -24,6 +24,7 @@ interface MessageInterface
24
  * @return string HTTP protocol version.
25
  */
26
  public function getProtocolVersion();
 
27
  /**
28
  * Return an instance with the specified HTTP protocol version.
29
  *
@@ -38,6 +39,7 @@ interface MessageInterface
38
  * @return static
39
  */
40
  public function withProtocolVersion($version);
 
41
  /**
42
  * Retrieves all message header values.
43
  *
@@ -64,6 +66,7 @@ interface MessageInterface
64
  * for that header.
65
  */
66
  public function getHeaders();
 
67
  /**
68
  * Checks if a header exists by the given case-insensitive name.
69
  *
@@ -73,6 +76,7 @@ interface MessageInterface
73
  * no matching header name is found in the message.
74
  */
75
  public function hasHeader($name);
 
76
  /**
77
  * Retrieves a message header value by the given case-insensitive name.
78
  *
@@ -88,6 +92,7 @@ interface MessageInterface
88
  * return an empty array.
89
  */
90
  public function getHeader($name);
 
91
  /**
92
  * Retrieves a comma-separated string of the values for a single header.
93
  *
@@ -108,6 +113,7 @@ interface MessageInterface
108
  * the message, this method MUST return an empty string.
109
  */
110
  public function getHeaderLine($name);
 
111
  /**
112
  * Return an instance with the provided value replacing the specified header.
113
  *
@@ -124,6 +130,7 @@ interface MessageInterface
124
  * @throws \InvalidArgumentException for invalid header names or values.
125
  */
126
  public function withHeader($name, $value);
 
127
  /**
128
  * Return an instance with the specified header appended with the given value.
129
  *
@@ -141,6 +148,7 @@ interface MessageInterface
141
  * @throws \InvalidArgumentException for invalid header names or values.
142
  */
143
  public function withAddedHeader($name, $value);
 
144
  /**
145
  * Return an instance without the specified header.
146
  *
@@ -154,12 +162,14 @@ interface MessageInterface
154
  * @return static
155
  */
156
  public function withoutHeader($name);
 
157
  /**
158
  * Gets the body of the message.
159
  *
160
  * @return StreamInterface Returns the body as a stream.
161
  */
162
  public function getBody();
 
163
  /**
164
  * Return an instance with the specified message body.
165
  *
@@ -173,5 +183,5 @@ interface MessageInterface
173
  * @return static
174
  * @throws \InvalidArgumentException When the body is not valid.
175
  */
176
- public function withBody(\_PhpScoper5b6804f9734c8\Psr\Http\Message\StreamInterface $body);
177
  }
1
  <?php
2
 
3
+ namespace Psr\Http\Message;
4
 
5
  /**
6
  * HTTP messages consist of requests from a client to a server and responses
24
  * @return string HTTP protocol version.
25
  */
26
  public function getProtocolVersion();
27
+
28
  /**
29
  * Return an instance with the specified HTTP protocol version.
30
  *
39
  * @return static
40
  */
41
  public function withProtocolVersion($version);
42
+
43
  /**
44
  * Retrieves all message header values.
45
  *
66
  * for that header.
67
  */
68
  public function getHeaders();
69
+
70
  /**
71
  * Checks if a header exists by the given case-insensitive name.
72
  *
76
  * no matching header name is found in the message.
77
  */
78
  public function hasHeader($name);
79
+
80
  /**
81
  * Retrieves a message header value by the given case-insensitive name.
82
  *
92
  * return an empty array.
93
  */
94
  public function getHeader($name);
95
+
96
  /**
97
  * Retrieves a comma-separated string of the values for a single header.
98
  *
113
  * the message, this method MUST return an empty string.
114
  */
115
  public function getHeaderLine($name);
116
+
117
  /**
118
  * Return an instance with the provided value replacing the specified header.
119
  *
130
  * @throws \InvalidArgumentException for invalid header names or values.
131
  */
132
  public function withHeader($name, $value);
133
+
134
  /**
135
  * Return an instance with the specified header appended with the given value.
136
  *
148
  * @throws \InvalidArgumentException for invalid header names or values.
149
  */
150
  public function withAddedHeader($name, $value);
151
+
152
  /**
153
  * Return an instance without the specified header.
154
  *
162
  * @return static
163
  */
164
  public function withoutHeader($name);
165
+
166
  /**
167
  * Gets the body of the message.
168
  *
169
  * @return StreamInterface Returns the body as a stream.
170
  */
171
  public function getBody();
172
+
173
  /**
174
  * Return an instance with the specified message body.
175
  *
183
  * @return static
184
  * @throws \InvalidArgumentException When the body is not valid.
185
  */
186
+ public function withBody(StreamInterface $body);
187
  }
includes/mollie-api-php/vendor/psr/http-message/src/RequestInterface.php CHANGED
@@ -1,6 +1,6 @@
1
  <?php
2
 
3
- namespace _PhpScoper5b6804f9734c8\Psr\Http\Message;
4
 
5
  /**
6
  * Representation of an outgoing, client-side request.
@@ -21,7 +21,7 @@ namespace _PhpScoper5b6804f9734c8\Psr\Http\Message;
21
  * be implemented such that they retain the internal state of the current
22
  * message and return an instance that contains the changed state.
23
  */
24
- interface RequestInterface extends \_PhpScoper5b6804f9734c8\Psr\Http\Message\MessageInterface
25
  {
26
  /**
27
  * Retrieves the message's request target.
@@ -40,6 +40,7 @@ interface RequestInterface extends \_PhpScoper5b6804f9734c8\Psr\Http\Message\Mes
40
  * @return string
41
  */
42
  public function getRequestTarget();
 
43
  /**
44
  * Return an instance with the specific request-target.
45
  *
@@ -58,12 +59,14 @@ interface RequestInterface extends \_PhpScoper5b6804f9734c8\Psr\Http\Message\Mes
58
  * @return static
59
  */
60
  public function withRequestTarget($requestTarget);
 
61
  /**
62
  * Retrieves the HTTP method of the request.
63
  *
64
  * @return string Returns the request method.
65
  */
66
  public function getMethod();
 
67
  /**
68
  * Return an instance with the provided HTTP method.
69
  *
@@ -80,6 +83,7 @@ interface RequestInterface extends \_PhpScoper5b6804f9734c8\Psr\Http\Message\Mes
80
  * @throws \InvalidArgumentException for invalid HTTP methods.
81
  */
82
  public function withMethod($method);
 
83
  /**
84
  * Retrieves the URI instance.
85
  *
@@ -90,6 +94,7 @@ interface RequestInterface extends \_PhpScoper5b6804f9734c8\Psr\Http\Message\Mes
90
  * representing the URI of the request.
91
  */
92
  public function getUri();
 
93
  /**
94
  * Returns an instance with the provided URI.
95
  *
@@ -120,5 +125,5 @@ interface RequestInterface extends \_PhpScoper5b6804f9734c8\Psr\Http\Message\Mes
120
  * @param bool $preserveHost Preserve the original state of the Host header.
121
  * @return static
122
  */
123
- public function withUri(\_PhpScoper5b6804f9734c8\Psr\Http\Message\UriInterface $uri, $preserveHost = \false);
124
  }
1
  <?php
2
 
3
+ namespace Psr\Http\Message;
4
 
5
  /**
6
  * Representation of an outgoing, client-side request.
21
  * be implemented such that they retain the internal state of the current
22
  * message and return an instance that contains the changed state.
23
  */
24
+ interface RequestInterface extends MessageInterface
25
  {
26
  /**
27
  * Retrieves the message's request target.
40
  * @return string
41
  */
42
  public function getRequestTarget();
43
+
44
  /**
45
  * Return an instance with the specific request-target.
46
  *
59
  * @return static
60
  */
61
  public function withRequestTarget($requestTarget);
62
+
63
  /**
64
  * Retrieves the HTTP method of the request.
65
  *
66
  * @return string Returns the request method.
67
  */
68
  public function getMethod();
69
+
70
  /**
71
  * Return an instance with the provided HTTP method.
72
  *
83
  * @throws \InvalidArgumentException for invalid HTTP methods.
84
  */
85
  public function withMethod($method);
86
+
87
  /**
88
  * Retrieves the URI instance.
89
  *
94
  * representing the URI of the request.
95
  */
96
  public function getUri();
97
+
98
  /**
99
  * Returns an instance with the provided URI.
100
  *
125
  * @param bool $preserveHost Preserve the original state of the Host header.
126
  * @return static
127
  */
128
+ public function withUri(UriInterface $uri, $preserveHost = false);
129
  }
includes/mollie-api-php/vendor/psr/http-message/src/ResponseInterface.php CHANGED
@@ -1,6 +1,6 @@
1
  <?php
2
 
3
- namespace _PhpScoper5b6804f9734c8\Psr\Http\Message;
4
 
5
  /**
6
  * Representation of an outgoing, server-side response.
@@ -17,7 +17,7 @@ namespace _PhpScoper5b6804f9734c8\Psr\Http\Message;
17
  * be implemented such that they retain the internal state of the current
18
  * message and return an instance that contains the changed state.
19
  */
20
- interface ResponseInterface extends \_PhpScoper5b6804f9734c8\Psr\Http\Message\MessageInterface
21
  {
22
  /**
23
  * Gets the response status code.
@@ -28,6 +28,7 @@ interface ResponseInterface extends \_PhpScoper5b6804f9734c8\Psr\Http\Message\Me
28
  * @return int Status code.
29
  */
30
  public function getStatusCode();
 
31
  /**
32
  * Return an instance with the specified status code and, optionally, reason phrase.
33
  *
@@ -49,6 +50,7 @@ interface ResponseInterface extends \_PhpScoper5b6804f9734c8\Psr\Http\Message\Me
49
  * @throws \InvalidArgumentException For invalid status code arguments.
50
  */
51
  public function withStatus($code, $reasonPhrase = '');
 
52
  /**
53
  * Gets the response reason phrase associated with the status code.
54
  *
1
  <?php
2
 
3
+ namespace Psr\Http\Message;
4
 
5
  /**
6
  * Representation of an outgoing, server-side response.
17
  * be implemented such that they retain the internal state of the current
18
  * message and return an instance that contains the changed state.
19
  */
20
+ interface ResponseInterface extends MessageInterface
21
  {
22
  /**
23
  * Gets the response status code.
28
  * @return int Status code.
29
  */
30
  public function getStatusCode();
31
+
32
  /**
33
  * Return an instance with the specified status code and, optionally, reason phrase.
34
  *
50
  * @throws \InvalidArgumentException For invalid status code arguments.
51
  */
52
  public function withStatus($code, $reasonPhrase = '');
53
+
54
  /**
55
  * Gets the response reason phrase associated with the status code.
56
  *
includes/mollie-api-php/vendor/psr/http-message/src/ServerRequestInterface.php CHANGED
@@ -1,6 +1,6 @@
1
  <?php
2
 
3
- namespace _PhpScoper5b6804f9734c8\Psr\Http\Message;
4
 
5
  /**
6
  * Representation of an incoming, server-side HTTP request.
@@ -40,7 +40,7 @@ namespace _PhpScoper5b6804f9734c8\Psr\Http\Message;
40
  * be implemented such that they retain the internal state of the current
41
  * message and return an instance that contains the changed state.
42
  */
43
- interface ServerRequestInterface extends \_PhpScoper5b6804f9734c8\Psr\Http\Message\RequestInterface
44
  {
45
  /**
46
  * Retrieve server parameters.
@@ -52,6 +52,7 @@ interface ServerRequestInterface extends \_PhpScoper5b6804f9734c8\Psr\Http\Messa
52
  * @return array
53
  */
54
  public function getServerParams();
 
55
  /**
56
  * Retrieve cookies.
57
  *
@@ -63,6 +64,7 @@ interface ServerRequestInterface extends \_PhpScoper5b6804f9734c8\Psr\Http\Messa
63
  * @return array
64
  */
65
  public function getCookieParams();
 
66
  /**
67
  * Return an instance with the specified cookies.
68
  *
@@ -81,6 +83,7 @@ interface ServerRequestInterface extends \_PhpScoper5b6804f9734c8\Psr\Http\Messa
81
  * @return static
82
  */
83
  public function withCookieParams(array $cookies);
 
84
  /**
85
  * Retrieve query string arguments.
86
  *
@@ -94,6 +97,7 @@ interface ServerRequestInterface extends \_PhpScoper5b6804f9734c8\Psr\Http\Messa
94
  * @return array
95
  */
96
  public function getQueryParams();
 
97
  /**
98
  * Return an instance with the specified query string arguments.
99
  *
@@ -117,6 +121,7 @@ interface ServerRequestInterface extends \_PhpScoper5b6804f9734c8\Psr\Http\Messa
117
  * @return static
118
  */
119
  public function withQueryParams(array $query);
 
120
  /**
121
  * Retrieve normalized file upload data.
122
  *
@@ -130,6 +135,7 @@ interface ServerRequestInterface extends \_PhpScoper5b6804f9734c8\Psr\Http\Messa
130
  * array MUST be returned if no data is present.
131
  */
132
  public function getUploadedFiles();
 
133
  /**
134
  * Create a new instance with the specified uploaded files.
135
  *
@@ -142,6 +148,7 @@ interface ServerRequestInterface extends \_PhpScoper5b6804f9734c8\Psr\Http\Messa
142
  * @throws \InvalidArgumentException if an invalid structure is provided.
143
  */
144
  public function withUploadedFiles(array $uploadedFiles);
 
145
  /**
146
  * Retrieve any parameters provided in the request body.
147
  *
@@ -158,6 +165,7 @@ interface ServerRequestInterface extends \_PhpScoper5b6804f9734c8\Psr\Http\Messa
158
  * These will typically be an array or object.
159
  */
160
  public function getParsedBody();
 
161
  /**
162
  * Return an instance with the specified body parameters.
163
  *
@@ -187,6 +195,7 @@ interface ServerRequestInterface extends \_PhpScoper5b6804f9734c8\Psr\Http\Messa
187
  * provided.
188
  */
189
  public function withParsedBody($data);
 
190
  /**
191
  * Retrieve attributes derived from the request.
192
  *
@@ -199,6 +208,7 @@ interface ServerRequestInterface extends \_PhpScoper5b6804f9734c8\Psr\Http\Messa
199
  * @return array Attributes derived from the request.
200
  */
201
  public function getAttributes();
 
202
  /**
203
  * Retrieve a single derived request attribute.
204
  *
@@ -215,6 +225,7 @@ interface ServerRequestInterface extends \_PhpScoper5b6804f9734c8\Psr\Http\Messa
215
  * @return mixed
216
  */
217
  public function getAttribute($name, $default = null);
 
218
  /**
219
  * Return an instance with the specified derived request attribute.
220
  *
@@ -231,6 +242,7 @@ interface ServerRequestInterface extends \_PhpScoper5b6804f9734c8\Psr\Http\Messa
231
  * @return static
232
  */
233
  public function withAttribute($name, $value);
 
234
  /**
235
  * Return an instance that removes the specified derived request attribute.
236
  *
1
  <?php
2
 
3
+ namespace Psr\Http\Message;
4
 
5
  /**
6
  * Representation of an incoming, server-side HTTP request.
40
  * be implemented such that they retain the internal state of the current
41
  * message and return an instance that contains the changed state.
42
  */
43
+ interface ServerRequestInterface extends RequestInterface
44
  {
45
  /**
46
  * Retrieve server parameters.
52
  * @return array
53
  */
54
  public function getServerParams();
55
+
56
  /**
57
  * Retrieve cookies.
58
  *
64
  * @return array
65
  */
66
  public function getCookieParams();
67
+
68
  /**
69
  * Return an instance with the specified cookies.
70
  *
83
  * @return static
84
  */
85
  public function withCookieParams(array $cookies);
86
+
87
  /**
88
  * Retrieve query string arguments.
89
  *
97
  * @return array
98
  */
99
  public function getQueryParams();
100
+
101
  /**
102
  * Return an instance with the specified query string arguments.
103
  *
121
  * @return static
122
  */
123
  public function withQueryParams(array $query);
124
+
125
  /**
126
  * Retrieve normalized file upload data.
127
  *
135
  * array MUST be returned if no data is present.
136
  */
137
  public function getUploadedFiles();
138
+
139
  /**
140
  * Create a new instance with the specified uploaded files.
141
  *
148
  * @throws \InvalidArgumentException if an invalid structure is provided.
149
  */
150
  public function withUploadedFiles(array $uploadedFiles);
151
+
152
  /**
153
  * Retrieve any parameters provided in the request body.
154
  *
165
  * These will typically be an array or object.
166
  */
167
  public function getParsedBody();
168
+
169
  /**
170
  * Return an instance with the specified body parameters.
171
  *
195
  * provided.
196
  */
197
  public function withParsedBody($data);
198
+
199
  /**
200
  * Retrieve attributes derived from the request.
201
  *
208
  * @return array Attributes derived from the request.
209
  */
210
  public function getAttributes();
211
+
212
  /**
213
  * Retrieve a single derived request attribute.
214
  *
225
  * @return mixed
226
  */
227
  public function getAttribute($name, $default = null);
228
+
229
  /**
230
  * Return an instance with the specified derived request attribute.
231
  *
242
  * @return static
243
  */
244
  public function withAttribute($name, $value);
245
+
246
  /**
247
  * Return an instance that removes the specified derived request attribute.
248
  *
includes/mollie-api-php/vendor/psr/http-message/src/StreamInterface.php CHANGED
@@ -1,6 +1,6 @@
1
  <?php
2
 
3
- namespace _PhpScoper5b6804f9734c8\Psr\Http\Message;
4
 
5
  /**
6
  * Describes a data stream.
@@ -26,12 +26,14 @@ interface StreamInterface
26
  * @return string
27
  */
28
  public function __toString();
 
29
  /**
30
  * Closes the stream and any underlying resources.
31
  *
32
  * @return void
33
  */
34
  public function close();
 
35
  /**
36
  * Separates any underlying resources from the stream.
37
  *
@@ -40,12 +42,14 @@ interface StreamInterface
40
  * @return resource|null Underlying PHP stream, if any
41
  */
42
  public function detach();
 
43
  /**
44
  * Get the size of the stream if known.
45
  *
46
  * @return int|null Returns the size in bytes if known, or null if unknown.
47
  */
48
  public function getSize();
 
49
  /**
50
  * Returns the current position of the file read/write pointer
51
  *
@@ -53,18 +57,21 @@ interface StreamInterface
53
  * @throws \RuntimeException on error.
54
  */
55
  public function tell();
 
56
  /**
57
  * Returns true if the stream is at the end of the stream.
58
  *
59
  * @return bool
60
  */
61
  public function eof();
 
62
  /**
63
  * Returns whether or not the stream is seekable.
64
  *
65
  * @return bool
66
  */
67
  public function isSeekable();
 
68
  /**
69
  * Seek to a position in the stream.
70
  *
@@ -77,7 +84,8 @@ interface StreamInterface
77
  * SEEK_END: Set position to end-of-stream plus offset.
78
  * @throws \RuntimeException on failure.
79
  */
80
- public function seek($offset, $whence = \SEEK_SET);
 
81
  /**
82
  * Seek to the beginning of the stream.
83
  *
@@ -89,12 +97,14 @@ interface StreamInterface
89
  * @throws \RuntimeException on failure.
90
  */
91
  public function rewind();
 
92
  /**
93
  * Returns whether or not the stream is writable.
94
  *
95
  * @return bool
96
  */
97
  public function isWritable();
 
98
  /**
99
  * Write data to the stream.
100
  *
@@ -103,12 +113,14 @@ interface StreamInterface
103
  * @throws \RuntimeException on failure.
104
  */
105
  public function write($string);
 
106
  /**
107
  * Returns whether or not the stream is readable.
108
  *
109
  * @return bool
110
  */
111
  public function isReadable();
 
112
  /**
113
  * Read data from the stream.
114
  *
@@ -120,6 +132,7 @@ interface StreamInterface
120
  * @throws \RuntimeException if an error occurs.
121
  */
122
  public function read($length);
 
123
  /**
124
  * Returns the remaining contents in a string
125
  *
@@ -128,6 +141,7 @@ interface StreamInterface
128
  * reading.
129
  */
130
  public function getContents();
 
131
  /**
132
  * Get stream metadata as an associative array or retrieve a specific key.
133
  *
1
  <?php
2
 
3
+ namespace Psr\Http\Message;
4
 
5
  /**
6
  * Describes a data stream.
26
  * @return string
27
  */
28
  public function __toString();
29
+
30
  /**
31
  * Closes the stream and any underlying resources.
32
  *
33
  * @return void
34
  */
35
  public function close();
36
+
37
  /**
38
  * Separates any underlying resources from the stream.
39
  *
42
  * @return resource|null Underlying PHP stream, if any
43
  */
44
  public function detach();
45
+
46
  /**
47
  * Get the size of the stream if known.
48
  *
49
  * @return int|null Returns the size in bytes if known, or null if unknown.
50
  */
51
  public function getSize();
52
+
53
  /**
54
  * Returns the current position of the file read/write pointer
55
  *
57
  * @throws \RuntimeException on error.
58
  */
59
  public function tell();
60
+
61
  /**
62
  * Returns true if the stream is at the end of the stream.
63
  *
64
  * @return bool
65
  */
66
  public function eof();
67
+
68
  /**
69
  * Returns whether or not the stream is seekable.
70
  *
71
  * @return bool
72
  */
73
  public function isSeekable();
74
+
75
  /**
76
  * Seek to a position in the stream.
77
  *
84
  * SEEK_END: Set position to end-of-stream plus offset.
85
  * @throws \RuntimeException on failure.
86
  */
87
+ public function seek($offset, $whence = SEEK_SET);
88
+
89
  /**
90
  * Seek to the beginning of the stream.
91
  *
97
  * @throws \RuntimeException on failure.
98
  */
99
  public function rewind();
100
+
101
  /**
102
  * Returns whether or not the stream is writable.
103
  *
104
  * @return bool
105
  */
106
  public function isWritable();
107
+
108
  /**
109
  * Write data to the stream.
110
  *
113
  * @throws \RuntimeException on failure.
114
  */
115
  public function write($string);
116
+
117
  /**
118
  * Returns whether or not the stream is readable.
119
  *
120
  * @return bool
121
  */
122
  public function isReadable();
123
+
124
  /**
125
  * Read data from the stream.
126
  *
132
  * @throws \RuntimeException if an error occurs.
133
  */
134
  public function read($length);
135
+
136
  /**
137
  * Returns the remaining contents in a string
138
  *
141
  * reading.
142
  */
143
  public function getContents();
144
+
145
  /**
146
  * Get stream metadata as an associative array or retrieve a specific key.
147
  *
includes/mollie-api-php/vendor/psr/http-message/src/UploadedFileInterface.php CHANGED
@@ -1,6 +1,6 @@
1
  <?php
2
 
3
- namespace _PhpScoper5b6804f9734c8\Psr\Http\Message;
4
 
5
  /**
6
  * Value object representing a file uploaded through an HTTP request.
@@ -29,6 +29,7 @@ interface UploadedFileInterface
29
  * created.
30
  */
31
  public function getStream();
 
32
  /**
33
  * Move the uploaded file to a new location.
34
  *
@@ -62,6 +63,7 @@ interface UploadedFileInterface
62
  * the second or subsequent call to the method.
63
  */
64
  public function moveTo($targetPath);
 
65
  /**
66
  * Retrieve the file size.
67
  *
@@ -72,6 +74,7 @@ interface UploadedFileInterface
72
  * @return int|null The file size in bytes or null if unknown.
73
  */
74
  public function getSize();
 
75
  /**
76
  * Retrieve the error associated with the uploaded file.
77
  *
@@ -87,6 +90,7 @@ interface UploadedFileInterface
87
  * @return int One of PHP's UPLOAD_ERR_XXX constants.
88
  */
89
  public function getError();
 
90
  /**
91
  * Retrieve the filename sent by the client.
92
  *
@@ -101,6 +105,7 @@ interface UploadedFileInterface
101
  * was provided.
102
  */
103
  public function getClientFilename();
 
104
  /**
105
  * Retrieve the media type sent by the client.
106
  *
1
  <?php
2
 
3
+ namespace Psr\Http\Message;
4
 
5
  /**
6
  * Value object representing a file uploaded through an HTTP request.
29
  * created.
30
  */
31
  public function getStream();
32
+
33
  /**
34
  * Move the uploaded file to a new location.
35
  *
63
  * the second or subsequent call to the method.
64
  */
65
  public function moveTo($targetPath);
66
+
67
  /**
68
  * Retrieve the file size.
69
  *
74
  * @return int|null The file size in bytes or null if unknown.
75
  */
76
  public function getSize();
77
+
78
  /**
79
  * Retrieve the error associated with the uploaded file.
80
  *
90
  * @return int One of PHP's UPLOAD_ERR_XXX constants.
91
  */
92
  public function getError();
93
+
94
  /**
95
  * Retrieve the filename sent by the client.
96
  *
105
  * was provided.
106
  */
107
  public function getClientFilename();
108
+
109
  /**
110
  * Retrieve the media type sent by the client.
111
  *
includes/mollie-api-php/vendor/psr/http-message/src/UriInterface.php CHANGED
@@ -1,6 +1,5 @@
1
  <?php
2
-
3
- namespace _PhpScoper5b6804f9734c8\Psr\Http\Message;
4
 
5
  /**
6
  * Value object representing a URI.
@@ -39,6 +38,7 @@ interface UriInterface
39
  * @return string The URI scheme.
40
  */
41
  public function getScheme();
 
42
  /**
43
  * Retrieve the authority component of the URI.
44
  *
@@ -58,6 +58,7 @@ interface UriInterface
58
  * @return string The URI authority, in "[user-info@]host[:port]" format.
59
  */
60
  public function getAuthority();
 
61
  /**
62
  * Retrieve the user information component of the URI.
63
  *
@@ -74,6 +75,7 @@ interface UriInterface
74
  * @return string The URI user information, in "username[:password]" format.
75
  */
76
  public function getUserInfo();
 
77
  /**
78
  * Retrieve the host component of the URI.
79
  *
@@ -86,6 +88,7 @@ interface UriInterface
86
  * @return string The URI host.
87
  */
88
  public function getHost();
 
89
  /**
90
  * Retrieve the port component of the URI.
91
  *
@@ -102,6 +105,7 @@ interface UriInterface
102
  * @return null|int The URI port.
103
  */
104
  public function getPort();
 
105
  /**
106
  * Retrieve the path component of the URI.
107
  *
@@ -128,6 +132,7 @@ interface UriInterface
128
  * @return string The URI path.
129
  */
130
  public function getPath();
 
131
  /**
132
  * Retrieve the query string of the URI.
133
  *
@@ -149,6 +154,7 @@ interface UriInterface
149
  * @return string The URI query string.
150
  */
151
  public function getQuery();
 
152
  /**
153
  * Retrieve the fragment component of the URI.
154
  *
@@ -166,6 +172,7 @@ interface UriInterface
166
  * @return string The URI fragment.
167
  */
168
  public function getFragment();
 
169
  /**
170
  * Return an instance with the specified scheme.
171
  *
@@ -182,6 +189,7 @@ interface UriInterface
182
  * @throws \InvalidArgumentException for invalid or unsupported schemes.
183
  */
184
  public function withScheme($scheme);
 
185
  /**
186
  * Return an instance with the specified user information.
187
  *
@@ -197,6 +205,7 @@ interface UriInterface
197
  * @return static A new instance with the specified user information.
198
  */
199
  public function withUserInfo($user, $password = null);
 
200
  /**
201
  * Return an instance with the specified host.
202
  *
@@ -210,6 +219,7 @@ interface UriInterface
210
  * @throws \InvalidArgumentException for invalid hostnames.
211
  */
212
  public function withHost($host);
 
213
  /**
214
  * Return an instance with the specified port.
215
  *
@@ -228,6 +238,7 @@ interface UriInterface
228
  * @throws \InvalidArgumentException for invalid ports.
229
  */
230
  public function withPort($port);
 
231
  /**
232
  * Return an instance with the specified path.
233
  *
@@ -251,6 +262,7 @@ interface UriInterface
251
  * @throws \InvalidArgumentException for invalid paths.
252
  */
253
  public function withPath($path);
 
254
  /**
255
  * Return an instance with the specified query string.
256
  *
@@ -267,6 +279,7 @@ interface UriInterface
267
  * @throws \InvalidArgumentException for invalid query strings.
268
  */
269
  public function withQuery($query);
 
270
  /**
271
  * Return an instance with the specified URI fragment.
272
  *
@@ -282,6 +295,7 @@ interface UriInterface
282
  * @return static A new instance with the specified fragment.
283
  */
284
  public function withFragment($fragment);
 
285
  /**
286
  * Return the string representation as a URI reference.
287
  *
1
  <?php
2
+ namespace Psr\Http\Message;
 
3
 
4
  /**
5
  * Value object representing a URI.
38
  * @return string The URI scheme.
39
  */
40
  public function getScheme();
41
+
42
  /**
43
  * Retrieve the authority component of the URI.
44
  *
58
  * @return string The URI authority, in "[user-info@]host[:port]" format.
59
  */
60
  public function getAuthority();
61
+
62
  /**
63
  * Retrieve the user information component of the URI.
64
  *
75
  * @return string The URI user information, in "username[:password]" format.
76
  */
77
  public function getUserInfo();
78
+
79
  /**
80
  * Retrieve the host component of the URI.
81
  *
88
  * @return string The URI host.
89
  */
90
  public function getHost();
91
+
92
  /**
93
  * Retrieve the port component of the URI.
94
  *
105
  * @return null|int The URI port.
106
  */
107
  public function getPort();
108
+
109
  /**
110
  * Retrieve the path component of the URI.
111
  *
132
  * @return string The URI path.
133
  */
134
  public function getPath();
135
+
136
  /**
137
  * Retrieve the query string of the URI.
138
  *
154
  * @return string The URI query string.
155
  */
156
  public function getQuery();
157
+
158
  /**
159
  * Retrieve the fragment component of the URI.
160
  *
172
  * @return string The URI fragment.
173
  */
174
  public function getFragment();
175
+
176
  /**
177
  * Return an instance with the specified scheme.
178
  *
189
  * @throws \InvalidArgumentException for invalid or unsupported schemes.
190
  */
191
  public function withScheme($scheme);
192
+
193
  /**
194
  * Return an instance with the specified user information.
195
  *
205
  * @return static A new instance with the specified user information.
206
  */
207
  public function withUserInfo($user, $password = null);
208
+
209
  /**
210
  * Return an instance with the specified host.
211
  *
219
  * @throws \InvalidArgumentException for invalid hostnames.
220
  */
221
  public function withHost($host);
222
+
223
  /**
224
  * Return an instance with the specified port.
225
  *
238
  * @throws \InvalidArgumentException for invalid ports.
239
  */
240
  public function withPort($port);
241
+
242
  /**
243
  * Return an instance with the specified path.
244
  *
262
  * @throws \InvalidArgumentException for invalid paths.
263
  */
264
  public function withPath($path);
265
+
266
  /**
267
  * Return an instance with the specified query string.
268
  *
279
  * @throws \InvalidArgumentException for invalid query strings.
280
  */
281
  public function withQuery($query);
282
+
283
  /**
284
  * Return an instance with the specified URI fragment.
285
  *
295
  * @return static A new instance with the specified fragment.
296
  */
297
  public function withFragment($fragment);
298
+
299
  /**
300
  * Return the string representation as a URI reference.
301
  *
includes/mollie/wc/plugin.php CHANGED
@@ -7,7 +7,7 @@ class Mollie_WC_Plugin
7
  {
8
  const PLUGIN_ID = 'mollie-payments-for-woocommerce';
9
  const PLUGIN_TITLE = 'Mollie Payments for WooCommerce';
10
- const PLUGIN_VERSION = '4.0.1';
11
 
12
  const DB_VERSION = '1.0';
13
  const DB_VERSION_PARAM_NAME = 'mollie-db-version';
7
  {
8
  const PLUGIN_ID = 'mollie-payments-for-woocommerce';
9
  const PLUGIN_TITLE = 'Mollie Payments for WooCommerce';
10
+ const PLUGIN_VERSION = '4.0.2';
11
 
12
  const DB_VERSION = '1.0';
13
  const DB_VERSION_PARAM_NAME = 'mollie-db-version';
mollie-payments-for-woocommerce.php CHANGED
@@ -3,7 +3,7 @@
3
  * Plugin Name: Mollie Payments for WooCommerce
4
  * Plugin URI: https://www.mollie.com
5
  * Description: Accept payments in WooCommerce with the official Mollie plugin
6
- * Version: 4.0.1
7
  * Author: Mollie
8
  * Author URI: https://www.mollie.com
9
  * Requires at least: 3.8
3
  * Plugin Name: Mollie Payments for WooCommerce
4
  * Plugin URI: https://www.mollie.com
5
  * Description: Accept payments in WooCommerce with the official Mollie plugin
6
+ * Version: 4.0.2
7
  * Author: Mollie
8
  * Author URI: https://www.mollie.com
9
  * Requires at least: 3.8
readme.txt CHANGED
@@ -3,7 +3,7 @@ Contributors: daanvm, davdebcom, l.vangunst, ndijkstra, robin-mollie
3
  Tags: mollie, payments, woocommerce, payment gateway, e-commerce, credit card, ideal, sofort, bancontact, bitcoin, direct debit, subscriptions
4
  Requires at least: 3.8
5
  Tested up to: 4.9
6
- Stable tag: 4.0.1
7
  Requires PHP: 5.6
8
  License: GPLv2 or later
9
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
@@ -169,6 +169,10 @@ Automatic updates should work like a charm; as always though, ensure you backup
169
 
170
  == Changelog ==
171
 
 
 
 
 
172
  = 4.0.1 - 06-08-2018 =
173
 
174
  IMPORTANT
3
  Tags: mollie, payments, woocommerce, payment gateway, e-commerce, credit card, ideal, sofort, bancontact, bitcoin, direct debit, subscriptions
4
  Requires at least: 3.8
5
  Tested up to: 4.9
6
+ Stable tag: 4.0.2
7
  Requires PHP: 5.6
8
  License: GPLv2 or later
9
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
169
 
170
  == Changelog ==
171
 
172
+ = 4.0.2 - 07-08-2018 =
173
+
174
+ * Fix - Reverted to older version of Mollie API PHP client, as it caused more issues than it fixed. This means conflicts with other plugins that use Guzzle are still possible. Use Mollie Payments For WooCommerce 3.0.6 if you also use plugins Klarna, Simple Locator, Cardinity, LeadPages, ConstantContact until we can provide a solution. If you experience issues, please contact us. [Please review this article.](https://github.com/mollie/WooCommerce/wiki/Composer-Guzzle-conflicts)
175
+
176
  = 4.0.1 - 06-08-2018 =
177
 
178
  IMPORTANT