'contribution_id' => $contribution['id'],
'total_amount' => 50,
);
- $payment = $this->callAPISuccess('payment', 'create', $params);
+ $payment = $this->callAPIAndDocument('payment', 'create', $params, __FUNCTION__, __FILE__);
$expectedResult = array(
$payment['id'] => array(
'from_financial_account_id' => 7,
foreach ($lineItems['values'] as $id => $ignore) {
$params['line_item'][] = array($id => array_pop($amounts));
}
- $payment = $this->callAPISuccess('payment', 'create', $params);
+ $payment = $this->callAPIAndDocument('payment', 'create', $params, __FUNCTION__, __FILE__, 'Payment with line item', 'CreatePaymentWithLineItems');
$expectedResult = array(
$payment['id'] => array(
'from_financial_account_id' => 7,
array_push(CRM_Core_Config::singleton()->userPermissionClass->permissions, 'access CiviCRM', 'edit contributions');
- $this->callAPIAndDocument('payment', 'cancel', $cancelParams);
+ $this->callAPIAndDocument('payment', 'cancel', $cancelParams, __FUNCTION__, __FILE__);
$payment = $this->callAPISuccess('payment', 'get', $params);
$this->assertEquals(2, $payment['count']);
$payment = $this->callAPIFailure('payment', 'delete', $deleteParams, 'API permission check failed for Payment/get call; insufficient permission: require access CiviCRM and delete in CiviContribute');
array_push(CRM_Core_Config::singleton()->userPermissionClass->permissions, 'access CiviCRM', 'delete in CiviContribute');
- $this->callAPISuccess('payment', 'delete', $cancelParams);
+ $this->callAPIAndDocument('payment', 'delete', $deleteParams, __FUNCTION__, __FILE__);
$payment = $this->callAPISuccess('payment', 'get', $params);
$this->assertEquals(0, $payment['count']);
$payment = $this->callAPIFailure('payment', 'create', $params, 'API permission check failed for Payment/get call; insufficient permission: require access CiviCRM and edit contributions');
array_push(CRM_Core_Config::singleton()->userPermissionClass->permissions, 'access CiviCRM', 'edit contributions');
- $payment = $this->callAPISuccess('payment', 'create', $params);
+ $payment = $this->callAPIAndDocument('payment', 'create', $params, __FUNCTION__, __FILE__, 'Update Payment', 'UpdatePayment');
$params = array(
'entity_table' => 'civicrm_financial_item',
'is_pay_later' => 1,
);
$contribution = $this->callAPISuccess('Contribution', 'create', $contributionParams);
- //Create partial payment
+ //add payment for pay later transaction
$params = array(
'contribution_id' => $contribution['id'],
'total_amount' => 100,