我正在使用btcpayserver和bitpay php API。尝试在付款中实施ipn并将变量发送到电子邮件。
ipn生成如下日志文件:
Raw IPN: {
"id": "KrYtvetS9oQ9s7CDErk,
"url": "https://btcpayserv.net/invoice?id=KrYtvetS9oQ9s7",
"posData": null,
"status": "paid",
"btcPrice": "0.00162327",
"price": 11.99,
"currency": "EUR",
"invoiceTime": 1569570609000,
"expirationTime": 1569571509000,
"currentTime": 1569570697070,
"btcPaid": "0.00162327",
"btcDue": "0.00000000",
"rate": 7386.36657706093,
"exceptionStatus": false,
"buyerFields": {
"buyerEmail": "buyeremail@test.com"
},
"transactionCurrency":
ipn在php中获取像这样的数据:$ ipn = json_decode($ raw_post_data);
php
$ipn = json_decode($raw_post_data);
$invoice = $client->getInvoice($ipn->id);
$invoiceId = $invoice->getId();
$invoiceUrl = $invoice->getUrl();
$invoiceStatus = $invoice->getStatus();
$invoiceExceptionStatus = $invoice->getExceptionStatus();
$invoicePrice = $invoice->getPrice();
$invoiceBtcPrice = $invoice->getbtcPrice();
我可以通过php邮件发送一些类似的字段:
$message = 'Date:' . $date . ', ID: ' . $invoiceId . ', Status: ' . $invoiceStatus . ', Url: ' . $invoiceUrl . ', BTC Price: ' . $invoiceBtcPrice . ', Price: ' . $invoicePrice;
但是我想发送RAW IPN的此变量:“ buyerEmail”:“ buyeremail@test.com”
无法做到。