Skip to content

Instantly share code, notes, and snippets.

@fwartner
Created March 2, 2018 07:32
Show Gist options
  • Save fwartner/0a684d042090a963cffd5df824dab687 to your computer and use it in GitHub Desktop.
Save fwartner/0a684d042090a963cffd5df824dab687 to your computer and use it in GitHub Desktop.
/**
* @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;
}
}
@petericebear
Copy link

profileId => customerId

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment