Skip to content

Commit 9a7cef3

Browse files
committed
Set Order endpoint as default to getPaymenMethods
1 parent 9a45386 commit 9a7cef3

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

src/Client.php

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -142,6 +142,9 @@ public function getMerchantPaymentMethods($merchant)
142142

143143
public function getPaymentMethods($uri, $options = array())
144144
{
145+
if (!preg_match('!^https?://!', $uri)) {
146+
$uri = $this->_endpoint . '/orders/' . $uri;
147+
}
145148
$this->initCurl($uri . '/payment_methods' . (count($options) > 0 ? '?' . http_build_query($options) : ''));
146149
curl_setopt($this->ch, CURLOPT_CUSTOMREQUEST, 'GET');
147150
curl_setopt($this->ch, CURLOPT_HTTPHEADER, array('Accept: text/html'));

0 commit comments

Comments
 (0)