Created
March 2, 2018 07:32
-
-
Save fwartner/0a684d042090a963cffd5df824dab687 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* @param $amount | |
* @param $token | |
* @param $destinationAccountId | |
* @param $applicationFee | |
* @return mixed|void | |
*/ | |
public function charge($amount, $token, $destinationAccountId, $applicationFee) | |
{ | |
try { | |
$payment = Mollie::api()->payments()->create([ | |
"amount" => $amount, | |
"description" => "My first API payment", | |
"redirectUrl" => "https://webshop.example.org/order/12345/", | |
"profileId" => $destinationAccountId, | |
"testmode" => env('APP_DEBUG'), | |
"applicationFee" => [ | |
"amount" => $applicationFee, | |
"description" => "Application Fee" | |
] | |
]); | |
} catch (Mollie_API_Exception $e) { | |
throw new PaymentFailedException; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
profileId => customerId