-
-
Save spencerfinnell/52188c2e94759e06547e7342ebe003aa to your computer and use it in GitHub Desktop.
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
<?php | |
/** | |
* Retrieve payment confirmation data. | |
*/ | |
add_action( 'init', function() { | |
$data = \SimplePay\Core\Payments\Payment_Confirmation\get_confirmation_data(); | |
if ( ! isset( $data['customer'] ) ) { | |
return; | |
} | |
$payment = current( $data['paymentintents'] ); | |
$charge = current( $payment->charges->data ); | |
$billing = $charge->billing_details; | |
$name = $billing->name; | |
// Do something with $name... | |
} ); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment