Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[wip]CRM-20158, added function to retrieve payment processor id #9879

Closed
wants to merge 2 commits into from

Conversation

pradpnayak
Copy link
Contributor


----------------------------------------
* CRM-20158: Store card type and last 4 digits of credit card
  https://issues.civicrm.org/jira/browse/CRM-20158
----------------------------------------
* CRM-20158: Store card type and last 4 digits of credit card
  https://issues.civicrm.org/jira/browse/CRM-20158
@eileenmcnaughton
Copy link
Contributor

eileenmcnaughton commented Feb 26, 2017

@colemanw can you take a look at this & confirm to what extent this function is required - it seems to me an api call would work in it's place & passing in $returnField as a parameter seems kinda dubious to me (like the sort of coding we used to do a lot of but are trying to move away from).

I feel like in theory this would work instead (although it could be wrapped in another function for readability)

$paymentProcessorID = $result = civicrm_api3('EntityFinancialTrxn', 'getvalue', array(
  'return' => array("financial_trxn_id.payment_processor_id.id"),
  'entity_table' => "civicrm_contribution",
  'entity_id' => 1,
));

@colemanw
Copy link
Member

colemanw commented Mar 2, 2017

I think this can be done with the api, similar to my commet in #9877

@eileenmcnaughton eileenmcnaughton changed the title CRM-20158, added function to retrieve payment processor id [wip]CRM-20158, added function to retrieve payment processor id Mar 3, 2017
@eileenmcnaughton
Copy link
Contributor

I just added the [wip] to indicate that it's not clear this PR should still be open - it looks like @colemanw 's approach should be used

@JoeMurray
Copy link
Contributor

I agree the API call suggested by @eileenmcnaughton does the same thing.

@JoeMurray JoeMurray closed this Mar 7, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
5 participants