Skip to content

Commit

Permalink
Refactoring
Browse files Browse the repository at this point in the history
  • Loading branch information
srmklive authored May 13, 2017
1 parent cdde1c0 commit 8ad325f
Showing 1 changed file with 3 additions and 5 deletions.
8 changes: 3 additions & 5 deletions src/Services/AdaptivePayments.php
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ private function setEnvelope()
*/
private function setPayRequestDetails($data)
{
$this->setRequestData([
$this->post = $this->setRequestData([
'actionType' => 'PAY',
'currencyCode' => $this->currency,
'receiverList' => [
Expand All @@ -86,10 +86,8 @@ private function setPayRequestDetails($data)
'cancelUrl' => $data['cancel_url'],
'requestEnvelope' => $this->setEnvelope(),
'feesPayer' => $data['payer'],
]);

$this->post = $this->post->filter(function ($value, $key) {
return (($key === 'feesPayer') && empty($value)) ?: $value;
])->filter(function ($value, $key) {
return (($key === 'feesPayer') && empty($value)) ? null : $value;
});
}

Expand Down

0 comments on commit 8ad325f

Please sign in to comment.