Skip to content

Commit

Permalink
Change iframe to url
Browse files Browse the repository at this point in the history
  • Loading branch information
lucidlogic committed Feb 16, 2018
1 parent 12dfe98 commit c2b7201
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 8 deletions.
5 changes: 1 addition & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -32,15 +32,12 @@ $url = Omnipay::create('Pesapal')
'your_secret'
)
->setCallbackUrl('https://example.com/callback')
->getIframeSrc(
->getUrl(
'[email protected]',
'my_reference',
'description',
100
);


echo "<iframe src='$iframeSrc' />";
```

### Check transaction status (from the pesapal ipn)
Expand Down
8 changes: 4 additions & 4 deletions src/Gateway.php
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,7 @@ public function getCallbackUrl()
*
* @return string
*/
public function getIframeSrc(
public function getUrl(
string $email,
string $reference,
string $description,
Expand All @@ -139,7 +139,7 @@ public function getIframeSrc(
PhoneNumber="' . $phoneNumber . '"
xmlns="' . $this::XMLNS . '" />';

return (string) $this->getIframeRequest(htmlentities($xml));
return (string) $this->getUrlRequest(htmlentities($xml));
}

/**
Expand All @@ -159,11 +159,11 @@ protected function getConsumer(): OAuthConsumer
*
* @return OAuthRequest
*/
protected function getIframeRequest(
protected function getUrlRequest(
string $xmlPayload
): OAuthRequest {
$consumer = $this->getConsumer();
//post transaction to pesapal
// post transaction to pesapal
$iframeRequest = OAuthRequest::getRequest(
$consumer,
$this->getApiDomain() . '/API/PostPesapalDirectOrderV4'
Expand Down

0 comments on commit c2b7201

Please sign in to comment.