function mollie_payment_update_status in Mollie Payment 7
Same name and namespace in other branches
- 7.2 mollie_payment.module \mollie_payment_update_status()
Update status of payment.
3 calls to mollie_payment_update_status()
- mollie_payment_listener in ./
mollie_payment.module - Listener callback.
- mollie_payment_recurring_listener in ./
mollie_payment.module - Recurring listener callback.
- mollie_payment_return in ./
mollie_payment.module - Return callback.
File
- ./
mollie_payment.module, line 355 - Provides Mollie integration for the Payment platform.
Code
function mollie_payment_update_status(Payment $payment, $mollie_status) {
$payment_status = array(
'open' => PAYMENT_STATUS_PENDING,
'cancelled' => PAYMENT_STATUS_CANCELLED,
'pending' => PAYMENT_STATUS_PENDING,
'paid' => PAYMENT_STATUS_SUCCESS,
'paidout' => PAYMENT_STATUS_MONEY_TRANSFERRED,
'refunded' => PAYMENT_STATUS_CANCELLED,
'expired' => PAYMENT_STATUS_EXPIRED,
'failed' => PAYMENT_STATUS_FAILED,
'charged_back' => PAYMENT_STATUS_CANCELLED,
);
$payment
->setStatus(new PaymentStatusItem($payment_status[$mollie_status]));
entity_save('payment', $payment);
}