Skip to content

Commit c7c68de

Browse files
committed
Fix getPaymentMethods endpoint
1 parent 33be7b8 commit c7c68de

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

src/Client.php

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -145,7 +145,10 @@ public function getMerchantPaymentMethods($merchant)
145145

146146
public function getPaymentMethods($uri, $options = array())
147147
{
148-
$this->initCurl($this->_endpoint . '/merchants/');
148+
if (!preg_match('!^https?://!', $uri)) {
149+
$uri = $this->_endpoint . '/orders/' . $uri;
150+
}
151+
$this->initCurl($uri . '/payment_methods' . (count($options) > 0 ? '?' . http_build_query($options) : ''));
149152
curl_setopt($this->ch, CURLOPT_CUSTOMREQUEST, 'GET');
150153
curl_setopt($this->ch, CURLOPT_HTTPHEADER, array('Accept: application/json'));
151154
$this->sendRequest();

0 commit comments

Comments
 (0)