Skip to content

Commit

Permalink
Rename receipt_url payment_url
Browse files Browse the repository at this point in the history
  • Loading branch information
gavinandresen committed Apr 15, 2013
1 parent 5f4a9b7 commit ea95a44
Show file tree
Hide file tree
Showing 6 changed files with 26 additions and 26 deletions.
2 changes: 1 addition & 1 deletion TODO.txt
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ Arguments:
--privatekey=path/to/key.pem
--memo="message"
--expires=timestamp
--receipt_url=URL
--payment_url=URL
--single_use
--out=path_to_file

Expand Down
8 changes: 4 additions & 4 deletions c++/paymentrequest-create.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
// amount= : amount (in BTC) that needs to be paid
// memo= : message to user
// expires= : unix timestamp (integer) when this Request expires
// receipt_url= : URL where a Payment message should be sent
// payment_url= : URL where a Payment message should be sent
// out= : file to write to (default: standard output)
// single_use : if specified, this will be a single-use Request
//
Expand Down Expand Up @@ -287,7 +287,7 @@ google::protobuf::uint64 BTC_to_satoshis(double btc)

int main(int argc, char **argv) {
std::list<string> expected = split("paytoaddress,amount,certificates,privatekey,memo,"
"expires,receipt_url,single_use,out", ",");
"expires,payment_url,single_use,out", ",");

map<string,string> params;
if (!parse_command_line(argc, argv, expected, params)) {
Expand Down Expand Up @@ -331,8 +331,8 @@ int main(int argc, char **argv) {
}
if (params.count("single_use"))
details.set_single_use(true);
if (params.count("receipt_url"))
details.set_receipt_url(params["receipt_url"]);
if (params.count("payment_url"))
details.set_payment_url(params["payment_url"]);

Output* out = details.add_outputs();
if (params.count("amount") > 0)
Expand Down
2 changes: 1 addition & 1 deletion paymentrequest.proto
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ message PaymentDetails {
optional uint64 expires = 4;
optional bool single_use = 5 [default = true];
optional string memo = 6;
optional string receipt_url = 7;
optional string payment_url = 7;
optional bytes merchant_data = 8;
}
message PaymentRequest {
Expand Down
4 changes: 2 additions & 2 deletions php/paymentrequest-create.php
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
amount= : amount (in BTC) that needs to be paid
memo= : message to user
expires= : unix timestamp (integer) when this Request expires
receipt_url= : URL where a Payment message should be sent
payment_url= : URL where a Payment message should be sent
out= : file to write to (default: standard output)
single_use= : 1 is single-use, 0 is multi-use
Expand Down Expand Up @@ -73,7 +73,7 @@
case "expires":
$details->setExpires($val);
break;
case "receipt_url":
case "payment_url":
$details->setReceiptUrl($val);
break;
case "out":
Expand Down
24 changes: 12 additions & 12 deletions php/paymentrequest.php
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<?php
// DO NOT EDIT! Generated by Protobuf-PHP protoc plugin 0.9.4
// Source: paymentrequest.proto
// Date: 2013-03-25 19:47:31
// Date: 2013-04-15 23:42:30

namespace payments {

Expand Down Expand Up @@ -144,7 +144,7 @@ class PaymentDetails extends \DrSlump\Protobuf\Message {
public $memo = null;

/** @var string */
public $receipt_url = null;
public $payment_url = null;

/** @var string */
public $merchant_data = null;
Expand Down Expand Up @@ -208,10 +208,10 @@ public static function descriptor()
$f->rule = \DrSlump\Protobuf::RULE_OPTIONAL;
$descriptor->addField($f);

// OPTIONAL STRING receipt_url = 7
// OPTIONAL STRING payment_url = 7
$f = new \DrSlump\Protobuf\Field();
$f->number = 7;
$f->name = "receipt_url";
$f->name = "payment_url";
$f->type = \DrSlump\Protobuf::TYPE_STRING;
$f->rule = \DrSlump\Protobuf::RULE_OPTIONAL;
$descriptor->addField($f);
Expand Down Expand Up @@ -474,39 +474,39 @@ public function setMemo( $value){
}

/**
* Check if <receipt_url> has a value
* Check if <payment_url> has a value
*
* @return boolean
*/
public function hasReceiptUrl(){
public function hasPaymentUrl(){
return $this->_has(7);
}

/**
* Clear <receipt_url> value
* Clear <payment_url> value
*
* @return \payments\PaymentDetails
*/
public function clearReceiptUrl(){
public function clearPaymentUrl(){
return $this->_clear(7);
}

/**
* Get <receipt_url> value
* Get <payment_url> value
*
* @return string
*/
public function getReceiptUrl(){
public function getPaymentUrl(){
return $this->_get(7);
}

/**
* Set <receipt_url> value
* Set <payment_url> value
*
* @param string $value
* @return \payments\PaymentDetails
*/
public function setReceiptUrl( $value){
public function setPaymentUrl( $value){
return $this->_set(7, $value);
}

Expand Down
12 changes: 6 additions & 6 deletions spec.rst
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ Payment requests are split into two messages to support future extensibility. Th
optional uint64 expires = 4;
optional bool single_use = 5 [default = true];
optional string memo = 6;
optional string receipt_url = 7;
optional string payment_url = 7;
optional bytes merchant_data = 8;
}

Expand All @@ -64,7 +64,7 @@ single_use: If true, these PaymentDetails should be used for only one payment. I

memo: UTF-8 encoded, plain-text (no formatting) note that should be displayed to the customer, explaining what this PaymentRequest is for.

receipt_url: Secure (usually https) location where a Payment message (see below) may be sent to obtain a PaymentACK.
payment_url: Secure (usually https) location where a Payment message (see below) may be sent to obtain a PaymentACK.

merchant_data : Arbitrary data that may be used by the merchant to identify the PaymentRequest. May be omitted if the merchant does not need to associate Payments with PaymentRequest or if they associate each PaymentRequest with a separate payment address.

Expand Down Expand Up @@ -121,12 +121,12 @@ memo : UTF-8 encoded, plain-text note from the customer to the merchant.
If the customer authorizes payment, then the Bitcoin client:

1. Creates and signs a transaction with one output sending the PaymentDetails.script
2. If there is no PaymentDetails.receipt_url, then the transaction should be broadcast on the Bitcoin p2p network.
3. Else send (POST if http/https) a Payment message to PaymentDetails.receipt_url and expect a PaymentACK in response.
2. If there is no PaymentDetails.payment_url, then the transaction should be broadcast on the Bitcoin p2p network.
3. Else send (POST if http/https) a Payment message to PaymentDetails.payment_url and expect a PaymentACK in response.

Clients may handle errors communicating with the receipt_url server however they like, but should assume that if they cannot communicate at all with the server then the Payment should either be retried later or immediately rejected.
Clients may handle errors communicating with the payment_url server however they like, but should assume that if they cannot communicate at all with the server then the Payment should either be retried later or immediately rejected.

PaymentDetails.receipt_url must be secure against man-in-the-middle attacks that might alter Payment.refund_to (if using HTTP, it must be TLS-protected).
PaymentDetails.payment_url must be secure against man-in-the-middle attacks that might alter Payment.refund_to (if using HTTP, it must be TLS-protected).

A merchant receiving a Payment will determine whether or not the transactions satisfy conditions of payment, and, if and only if they do, broadcast the transactions on the Bitcoin p2p network. It must return a PaymentACK message to let the customer know whether payment was accepted or rejected.

Expand Down

0 comments on commit ea95a44

Please sign in to comment.