Is it possible to query a payment's expire_month and expiry_year?

tcannady
New Community Member

Our app uses Braintree to accept payments. We have a few features which rely on knowing a credit card's expiration date, for example the user-facing "Billing" page, and a "your card is about to expire" email which is triggered off of this data.

 

We're working on adding PayPal integration to the Braintree Web UI Drop-In. Everything is basically hooked up in that we can make a purchase which is registered in Braintree/PayPal (photos below), however we can't find out how to query the credit card and it's respective expire_month and expire_year.

 

In regards to the API, I was under the impression that the "payment" object might include these details. We've use the API to query this using the payment's ID, but the response does not include a credit_card field (response below). However this section of the API docs lead us to believe the field should be present.

 

Thanks in advance for any guidance.

 

Sandbox example (using the PayPal-Ruby-SDK gem)

[9] pry(main)> Braintree::CreditCard.from_nonce('3975[Removed. Phone #s not permitted]1419-63fe2a681c98')
[Braintree] [29/Ja[Removed. Phone #s not permitted]UTC] GET /merchants/y7xxbdyhds6td4xk/payment_methods/from_nonce/3975[Removed. Phone #s not permitted]1419-63fe2a681c98
[Braintree] [29/Ja[Removed. Phone #s not permitted]UTC] GET /merchants/y7xxbdyhds6td4xk/payment_methods/from_nonce/3975[Removed. Phone #s not permitted]1419-63fe2a681c98 200
[Braintree] [29/Ja[Removed. Phone #s not permitted]UTC] 200 OK
[Braintree] <?xml version="1.0" encoding="UTF-8"?>
[Braintree] <paypal-account>
[Braintree]   <billing-agreement-id>B-98S21254J88333913</billing-agreement-id>
[Braintree]   <created-at type="datetime">2019-01-29T01:29:45Z</created-at>
[Braintree]   <customer-id>177846769</customer-id>
[Braintree]   <default type="boolean">false</default>
[Braintree]   <email>redacted.com</email>
[Braintree]   <global-id>cGF5bWVudG1ldGhvZF81Ym1rOHM</global-id>
[Braintree]   <image-url>https://assets.braintreegateway.com/payment_method_logo/paypal.png?environment=sandbox</image-url>
[Braintree]   <subscriptions type="array">
[Braintree]     <subscription>
[Braintree]       <add-ons type="array"/>
[Braintree]       <balance>0.00</balance>
[Braintree]       <billing-day-of-month type="integer">28</billing-day-of-month>
[Braintree]       <billing-period-end-date type="date">2020-01-27</billing-period-end-date>
[Braintree]       <billing-period-start-date type="date">2019-01-28</billing-period-start-date>
[Braintree]       <created-at type="datetime">2019-01-29T01:30:12Z</created-at>
[Braintree]       <updated-at type="datetime">2019-01-29T01:30:12Z</updated-at>
[Braintree]       <current-billing-cycle type="integer">1</current-billing-cycle>
[Braintree]       <days-past-due nil="true"/>
[Braintree]       <discounts type="array"/>
[Braintree]       <failure-count type="integer">0</failure-count>
[Braintree]       <first-billing-date type="date">2019-01-28</first-billing-date>
[Braintree]       <id>h6832b</id>
[Braintree]       <merchant-account-id>qwyv593cxnjmdfjt</merchant-account-id>
[Braintree]       <never-expires type="boolean">true</never-expires>
[Braintree]       <next-bill-amount>96.00</next-bill-amount>
[Braintree]       <next-billing-period-amount>96.00</next-billing-period-amount>
[Braintree]       <next-billing-date type="date">2020-01-28</next-billing-date>
[Braintree]       <number-of-billing-cycles nil="true"/>
[Braintree]       <paid-through-date type="date">2020-01-27</paid-through-date>
[Braintree]       <payment-method-token>5bmk8s</payment-method-token>
[Braintree]       <plan-id>nj62</plan-id>
[Braintree]       <price>96.00</price>
[Braintree]       <status>Active</status>
[Braintree]       <trial-duration nil="true"/>
[Braintree]       <trial-duration-unit nil="true"/>
[Braintree]       <trial-period type="boolean">false</trial-period>
[Braintree]       <descriptor>
[Braintree]         <name nil="true"/>
[Braintree]         <phone nil="true"/>
[Braintree]         <url nil="true"/>
[Braintree]       </descriptor>
[Braintree]       <description nil="true"/>
[Braintree]       <transactions type="array">
[Braintree]         <transaction>
[Braintree]           <id>kmck6vy9</id>
[Braintree]           <status>settled</status>
[Braintree]           <type>sale</type>
[Braintree]           <currency-iso-code>USD</currency-iso-code>
[Braintree]           <amount>96.00</amount>
[Braintree]           <merchant-account-id>qwyv593cxnjmdfjt</merchant-account-id>
[Braintree]           <sub-merchant-account-id nil="true"/>
[Braintree]           <master-merchant-account-id nil="true"/>
[Braintree]           <order-id nil="true"/>
[Braintree]           <created-at type="datetime">2019-01-29T01:30:08Z</created-at>
[Braintree]           <updated-at type="datetime">2019-01-29T02:05:40Z</updated-at>
[Braintree]           <customer>
[Braintree]             <id>177846769</id>
[Braintree]             <first-name>Redacted</first-name>
[Braintree]             <last-name>Redacted</last-name>
[Braintree]             <company>Redacted</company>
[Braintree]             <email>redacted.com</email>
[Braintree]             <website nil="true"/>
[Braintree]             <phone nil="true"/>
[Braintree]             <fax nil="true"/>
[Braintree]           </customer>
[Braintree]           <billing>
[Braintree]             <id nil="true"/>
[Braintree]             <first-name nil="true"/>
[Braintree]             <last-name nil="true"/>
[Braintree]             <company nil="true"/>
[Braintree]             <street-address nil="true"/>
[Braintree]             <extended-address nil="true"/>
[Braintree]             <locality nil="true"/>
[Braintree]             <region nil="true"/>
[Braintree]             <postal-code nil="true"/>
[Braintree]             <country-name nil="true"/>
[Braintree]             <country-code-alpha2 nil="true"/>
[Braintree]             <country-code-alpha3 nil="true"/>
[Braintree]             <country-code-numeric nil="true"/>
[Braintree]           </billing>
[Braintree]           <refund-id nil="true"/>
[Braintree]           <refund-ids type="array"/>
[Braintree]           <refunded-transaction-id nil="true"/>
[Braintree]           <partial-settlement-transaction-ids type="array"/>
[Braintree]           <authorized-transaction-id nil="true"/>
[Braintree]           <settlement-batch-id>2019-01-29_qwyv593cxnjmdfjt_nhj1ddja</settlement-batch-id>
[Braintree]           <shipping>
[Braintree]             <id nil="true"/>
[Braintree]             <first-name nil="true"/>
[Braintree]             <last-name nil="true"/>
[Braintree]             <company nil="true"/>
[Braintree]             <street-address nil="true"/>
[Braintree]             <extended-address nil="true"/>
[Braintree]             <locality nil="true"/>
[Braintree]             <region nil="true"/>
[Braintree]             <postal-code nil="true"/>
[Braintree]             <country-name nil="true"/>
[Braintree]             <country-code-alpha2 nil="true"/>
[Braintree]             <country-code-alpha3 nil="true"/>
[Braintree]             <country-code-numeric nil="true"/>
[Braintree]           </shipping>
[Braintree]           <custom-fields/>
[Braintree]           <avs-error-response-code nil="true"/>
[Braintree]           <avs-postal-code-response-code>I</avs-postal-code-response-code>
[Braintree]           <avs-street-address-response-code>I</avs-street-address-response-code>
[Braintree]           <cvv-response-code>I</cvv-response-code>
[Braintree]           <gateway-rejection-reason nil="true"/>
[Braintree]           <processor-authorization-code nil="true"/>
[Braintree]           <processor-response-code>1000</processor-response-code>
[Braintree]           <processor-response-text>Approved</processor-response-text>
[Braintree]           <additional-processor-response nil="true"/>
[Braintree]           <voice-referral-number nil="true"/>
[Braintree]           <purchase-order-number nil="true"/>
[Braintree]           <tax-amount nil="true"/>
[Braintree]           <tax-exempt type="boolean">false</tax-exempt>
[Braintree]           <credit-card>
[Braintree]             <token>5bmk8s</token>
[Braintree]             <bin nil="true"/>
[Braintree]             <last-4 nil="true"/>
[Braintree]             <card-type nil="true"/>
[Braintree]             <expiration-month></expiration-month>
[Braintree]             <expiration-year></expiration-year>
[Braintree]             <customer-location nil="true"/>
[Braintree]             <cardholder-name nil="true"/>
[Braintree]             <image-url>https://assets.braintreegateway.com/payment_method_logo/unknown.png?environment=sandbox</image-url>
[Braintree]             <prepaid>Unknown</prepaid>
[Braintree]             <healthcare>Unknown</healthcare>
[Braintree]             <debit>Unknown</debit>
[Braintree]             <durbin-regulated>Unknown</durbin-regulated>
[Braintree]             <commercial>Unknown</commercial>
[Braintree]             <payroll>Unknown</payroll>
[Braintree]             <issuing-bank>Unknown</issuing-bank>
[Braintree]             <country-of-issuance>Unknown</country-of-issuance>
[Braintree]             <product-id>Unknown</product-id>
[Braintree]             <global-id>cGF5bWVudG1ldGhvZF81Ym1rOHM</global-id>
[Braintree]             <account-type nil="true"/>
[Braintree]             <unique-number-identifier nil="true"/>
[Braintree]             <venmo-sdk type="boolean">false</venmo-sdk>
[Braintree]           </credit-card>
[Braintree]           <paypal>
[Braintree]             <token>5bmk8s</token>
[Braintree]             <payer-email>redacted.com</payer-email>
[Braintree]             <payment-id>PAYID-LRH2ZII8YS71524SE091861S</payment-id>
[Braintree]             <authorization-id>9EJ696249P218074S</authorization-id>
[Braintree]             <image-url>https://assets.braintreegateway.com/payment_method_logo/paypal.png?environment=sandbox</image-url>
[Braintree]             <debug-id>1cd5c24136d8e</debug-id>
[Braintree]             <payee-id nil="true"/>
[Braintree]             <payee-email nil="true"/>
[Braintree]             <custom-field nil="true"/>
[Braintree]             <payer-id>XUWZHQX4PLUA8</payer-id>
[Braintree]             <payer-first-name>test</payer-first-name>
[Braintree]             <payer-last-name>buyer</payer-last-name>
[Braintree]             <payer-status>VERIFIED</payer-status>
[Braintree]             <seller-protection-status>ELIGIBLE</seller-protection-status>
[Braintree]             <capture-id>9EJ696249P218074S</capture-id>
[Braintree]             <refund-id nil="true"/>
[Braintree]             <transaction-fee-amount>3.08</transaction-fee-amount>
[Braintree]             <transaction-fee-currency-iso-code>USD</transaction-fee-currency-iso-code>
[Braintree]             <description nil="true"/>
[Braintree]             <global-id>cGF5bWVudG1ldGhvZF81Ym1rOHM</global-id>
[Braintree]           </paypal>
[Braintree]           <status-history type="array">
[Braintree]             <status-event>
[Braintree]               <timestamp type="datetime">2019-01-29T01:30:12Z</timestamp>
[Braintree]               <status>authorized</status>
[Braintree]               <amount>96.00</amount>
[Braintree]               <user>Fantaz1</user>
[Braintree]               <transaction-source>recurring</transaction-source>
[Braintree]             </status-event>
[Braintree]             <status-event>
[Braintree]               <timestamp type="datetime">2019-01-29T01:30:12Z</timestamp>
[Braintree]               <status>submitted_for_settlement</status>
[Braintree]               <amount>96.00</amount>
[Braintree]               <user>Fantaz1</user>
[Braintree]               <transaction-source>recurring</transaction-source>
[Braintree]             </status-event>
[Braintree]             <status-event>
[Braintree]               <timestamp type="datetime">2019-01-29T01:30:12Z</timestamp>
[Braintree]               <status>settling</status>
[Braintree]               <amount>96.00</amount>
[Braintree]               <user>Fantaz1</user>
[Braintree]               <transaction-source>recurring</transaction-source>
[Braintree]             </status-event>
[Braintree]             <status-event>
[Braintree]               <timestamp type="datetime">2019-01-29T02:05:40Z</timestamp>
[Braintree]               <status>settled</status>
[Braintree]               <amount>96.00</amount>
[Braintree]               <user nil="true"/>
[Braintree]               <transaction-source></transaction-source>
[Braintree]             </status-event>
[Braintree]           </status-history>
[Braintree]           <plan-id>nj62</plan-id>
[Braintree]           <subscription-id>h6832b</subscription-id>
[Braintree]           <subscription>
[Braintree]             <billing-period-end-date type="date">2020-01-27</billing-period-end-date>
[Braintree]             <billing-period-start-date type="date">2019-01-28</billing-period-start-date>
[Braintree]           </subscription>
[Braintree]           <add-ons type="array"/>
[Braintree]           <discounts type="array"/>
[Braintree]           <descriptor>
[Braintree]             <name nil="true"/>
[Braintree]             <phone nil="true"/>
[Braintree]             <url nil="true"/>
[Braintree]           </descriptor>
[Braintree]           <recurring type="boolean">true</recurring>
[Braintree]           <channel nil="true"/>
[Braintree]           <service-fee-amount nil="true"/>
[Braintree]           <escrow-status nil="true"/>
[Braintree]           <disbursement-details>
[Braintree]             <disbursement-date type="date">2019-01-29</disbursement-date>
[Braintree]             <settlement-amount>96.00</settlement-amount>
[Braintree]             <settlement-currency-iso-code>USD</settlement-currency-iso-code>
[Braintree]             <settlement-currency-exchange-rate>1</settlement-currency-exchange-rate>
[Braintree]             <funds-held type="boolean">false</funds-held>
[Braintree]             <success type="boolean">true</success>
[Braintree]           </disbursement-details>
[Braintree]           <disputes type="array"/>
[Braintree]           <authorization-adjustments type="array"/>
[Braintree]           <payment-instrument-type>paypal_account</payment-instrument-type>
[Braintree]           <processor-settlement-response-code>4000</processor-settlement-response-code>
[Braintree]           <processor-settlement-response-text>Confirmed</processor-settlement-response-text>
[Braintree]           <three-d-secure-info nil="true"/>
[Braintree]           <ships-from-postal-code nil="true"/>
[Braintree]           <shipping-amount nil="true"/>
[Braintree]           <discount-amount nil="true"/>
[Braintree]           <network-transaction-id nil="true"/>
[Braintree]           <refund-global-ids type="array"/>
[Braintree]           <partial-settlement-transaction-global-ids type="array"/>
[Braintree]           <refunded-transaction-global-id nil="true"/>
[Braintree]           <authorized-transaction-global-id nil="true"/>
[Braintree]           <global-id>dHJhbnNhY3Rpb25fa21jazZ2eTk</global-id>
[Braintree]           <processor-response-type>approved</processor-response-type>
[Braintree]           <authorization-expires-at type="datetime">2019-02-28T01:30:12Z</authorization-expires-at>
[Braintree]         </transaction>
[Braintree]       </transactions>
[Braintree]       <status-history type="array">
[Braintree]         <status-event>
[Braintree]           <timestamp type="datetime">2019-01-29T01:30:12Z</timestamp>
[Braintree]           <status>Active</status>
[Braintree]           <user>Fantaz1</user>
[Braintree]           <subscription-source>api</subscription-source>
[Braintree]           <balance>0.00</balance>
[Braintree]           <price>96.00</price>
[Braintree]           <currency-iso-code>USD</currency-iso-code>
[Braintree]           <plan-id>nj62</plan-id>
[Braintree]         </status-event>
[Braintree]       </status-history>
[Braintree]     </subscription>
[Braintree]   </subscriptions>
[Braintree]   <token>5bmk8s</token>
[Braintree]   <updated-at type="datetime">2019-01-29T01:29:45Z</updated-at>
[Braintree]   <is-channel-initiated type="boolean">false</is-channel-initiated>
[Braintree]   <payer-id>XUWZHQX4PLUA8</payer-id>
[Braintree]   <payer-info nil="true"/>
[Braintree]   <limited-use-order-id nil="true"/>
[Braintree] </paypal-account>

Paypal purchase:

Screen Shot 2019-01-29 at 2.36.44 PM.png

 

PayPal purchase details:

Screen Shot 2019-01-29 at 2.37.00 PM.png

 

Braintree subscription:

Screen Shot 2019-01-29 at 2.37.47 PM.png

Login to Me Too
0 REPLIES 0

Haven't Found your Answer?

It happens. Hit the "Login to Ask the community" button to create a question for the PayPal community.