This project requires the coding of a script on a webserver that will listen for a Coinpayments IPN sent to a URL and on receipt send two emails to separate addresses.
The IPN data comes in HTTP POST format and includes the following fields:
ipn_version = '1.0'
ipn_id = 'thes_is_a_secret_string_set_by_the_merchant'
ipn_mode = 'hmac'
merchant = 'this_is_the_merchant_ID'
ipn_type = 'button'
txn_id = 'CPCG2FRT3SO8QNVLIRXXKM9JSD'
status = '100'
status_text = 'Payment Complete.'
currency1 = 'USD'
currency2 = 'BCH'
amount1 = '10'
amount2 = '0.01243'
subtotal = '10'
shipping = '0'
tax = '0'
fee = '6.0E-5'
item_amount = '10'
item_name = 'Securenode'
quantity = '1'
first_name = 'znyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyy'
last_name = 'Sec'
email = 'customer@[login to view URL]'
received_amount = '0'
received_confirms = '0'
and needs to be repackaged and sent as two emails
Email 1 looks like this (with data nodeStkT & nodeType from first_name & last_name respectively) and can be a JSON file:
To: provider@[login to view URL] (this doesn't change)
Email 2 looks like this (with data 'email' used as to: address and 'first_name' used in body of email). I will need to add formatting and styling to this email:
To: customer@[login to view URL]
Subject: Order complete
Thanks you for ordering your product. Your payment has been received and we will send your product to (znyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyy) shortly.
The coinpayments site has the following documentation regarding the IPN and PHP code snippets: [login to view URL]