Created
October 12, 2012 22:02
-
-
Save phylaxis/3881830 to your computer and use it in GitHub Desktop.
Get Payment Details
This file contains 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
SELECT subscriptions.subscription_id, | |
client_gateways.alias, | |
(CASE client_gateways.alias WHEN 'Authorize.net' THEN 'Credit Card' | |
WHEN 'PayPal Express Checkout' THEN 'Pay Pal' | |
ELSE '' END) as 'payment_type', | |
subscriptions.card_last_four, | |
subscriptions.amount, | |
IF (client_gateways.alias = 'Authorize.net' AND subscriptions.card_last_four != '',true,false) AS 'card_on_file' | |
FROM subscriptions | |
INNER JOIN customers ON subscriptions.customer_id = customers.customer_id | |
INNER JOIN client_gateways ON subscriptions.gateway_id = client_gateways.client_gateway_id | |
WHERE subscriptions.subscription_id = 2266 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment