opennodedev / opennode-php

OpenNode PHP library for API v1
https://opennode.co/docs
MIT License
16 stars 5 forks source link

Demo code error LN BOLT11 + typo on `Charge` #3

Closed webdev23 closed 5 years ago

webdev23 commented 5 years ago

Demo error:

  echo 'LN BOLT11: ' . $charge->lightning_invoice->payreq;
  echo 'LN BOLT11: ' . $charge->lightning_invoice["payreq"].PHP_EOL;
  echo 'BTC address: ' . $charge->chain_invoice->address
  echo 'BTC address: ' . $charge->chain_invoice->address;

Fixed.

AtlantisPleb commented 5 years ago

Still get an error with $charge->chain_invoice->address; because both lightning_invoice and chain_invoice are arrays not objects.

Should be $charge->chain_invoice['address'];