Skip to content

Commit

Permalink
Removed PaymentDetails.single_use and PaymentACK.accepted
Browse files Browse the repository at this point in the history
  • Loading branch information
gavinandresen committed Apr 17, 2013
1 parent ea95a44 commit c70b18b
Show file tree
Hide file tree
Showing 3 changed files with 64 additions and 162 deletions.
45 changes: 22 additions & 23 deletions paymentrequest.proto
Original file line number Diff line number Diff line change
Expand Up @@ -10,38 +10,37 @@ package payments;
option java_package = "org.bitcoin.protocols.payments";
option java_outer_classname = "Protos";

// Generalized form of "send payment to this/these bitcoin addresses"
message Output {
optional uint64 amount = 1 [default = 0];
required bytes script = 2;
optional uint64 amount = 1 [default = 0]; // amount is integer-number-of-satoshis
required bytes script = 2; // usually one of the standard Script forms
}
message PaymentDetails {
optional string network = 1 [default = "main"];
repeated Output outputs = 2;
required uint64 time = 3;
optional uint64 expires = 4;
optional bool single_use = 5 [default = true];
optional string memo = 6;
optional string payment_url = 7;
optional bytes merchant_data = 8;
}
optional string network = 1 [default = "main"]; // "main" or "test"
repeated Output outputs = 2; // Where payment should be sent
required uint64 time = 3; // Timestamp; when payment request created
optional uint64 expires = 4; // Timestamp; when this request should be considered invalid
optional string memo = 5; // Human-readable description of request for the customer
optional string payment_url = 6; // URL to send Payment and get PaymentACK
optional bytes merchant_data = 7; // Arbitrary data to include in the Payment message
}
message PaymentRequest {
optional uint32 payment_details_version = 1 [default = 1];
optional string pki_type = 2 [default = "none"];
optional bytes pki_data = 3;
required bytes serialized_payment_details = 4;
optional bytes signature = 5;
optional string pki_type = 2 [default = "none"]; // none / x509+sha256 / x509+sha1
optional bytes pki_data = 3; // depends on pki_type
required bytes serialized_payment_details = 4; // PaymentDetails
optional bytes signature = 5; // pki-dependent signature
}
message X509Certificates {
repeated bytes certificate = 1;
repeated bytes certificate = 1; // DER-encoded X.509 certificate chain
}
message Payment {
optional bytes merchant_data = 1;
repeated bytes transactions = 2;
repeated Output refund_to = 3;
optional string memo = 4;
optional bytes merchant_data = 1; // From PaymentDetails.merchant_data
repeated bytes transactions = 2; // Signed transactions that satisfy PaymentDetails.outputs
repeated Output refund_to = 3; // Where to send refunds, if a refund is necessary
optional string memo = 4; // Human-readable message for the merchant
}
message PaymentACK {
required Payment payment = 1;
required bool accepted = 2;
optional string memo = 3;
required Payment payment = 1; // Payment message that triggered this ACK
optional string memo = 2; // human-readable message for customer
}
143 changes: 23 additions & 120 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-04-15 23:42:30
// Date: 2013-04-17 18:43:15

namespace payments {

Expand Down Expand Up @@ -137,9 +137,6 @@ class PaymentDetails extends \DrSlump\Protobuf\Message {
/** @var int */
public $expires = null;

/** @var boolean */
public $single_use = true;

/** @var string */
public $memo = null;

Expand Down Expand Up @@ -191,34 +188,25 @@ public static function descriptor()
$f->rule = \DrSlump\Protobuf::RULE_OPTIONAL;
$descriptor->addField($f);

// OPTIONAL BOOL single_use = 5
// OPTIONAL STRING memo = 5
$f = new \DrSlump\Protobuf\Field();
$f->number = 5;
$f->name = "single_use";
$f->type = \DrSlump\Protobuf::TYPE_BOOL;
$f->rule = \DrSlump\Protobuf::RULE_OPTIONAL;
$f->default = true;
$descriptor->addField($f);

// OPTIONAL STRING memo = 6
$f = new \DrSlump\Protobuf\Field();
$f->number = 6;
$f->name = "memo";
$f->type = \DrSlump\Protobuf::TYPE_STRING;
$f->rule = \DrSlump\Protobuf::RULE_OPTIONAL;
$descriptor->addField($f);

// OPTIONAL STRING payment_url = 7
// OPTIONAL STRING payment_url = 6
$f = new \DrSlump\Protobuf\Field();
$f->number = 7;
$f->number = 6;
$f->name = "payment_url";
$f->type = \DrSlump\Protobuf::TYPE_STRING;
$f->rule = \DrSlump\Protobuf::RULE_OPTIONAL;
$descriptor->addField($f);

// OPTIONAL BYTES merchant_data = 8
// OPTIONAL BYTES merchant_data = 7
$f = new \DrSlump\Protobuf\Field();
$f->number = 8;
$f->number = 7;
$f->name = "merchant_data";
$f->type = \DrSlump\Protobuf::TYPE_BYTES;
$f->rule = \DrSlump\Protobuf::RULE_OPTIONAL;
Expand Down Expand Up @@ -399,50 +387,13 @@ public function setExpires( $value){
return $this->_set(4, $value);
}

/**
* Check if <single_use> has a value
*
* @return boolean
*/
public function hasSingleUse(){
return $this->_has(5);
}

/**
* Clear <single_use> value
*
* @return \payments\PaymentDetails
*/
public function clearSingleUse(){
return $this->_clear(5);
}

/**
* Get <single_use> value
*
* @return boolean
*/
public function getSingleUse(){
return $this->_get(5);
}

/**
* Set <single_use> value
*
* @param boolean $value
* @return \payments\PaymentDetails
*/
public function setSingleUse( $value){
return $this->_set(5, $value);
}

/**
* Check if <memo> has a value
*
* @return boolean
*/
public function hasMemo(){
return $this->_has(6);
return $this->_has(5);
}

/**
Expand All @@ -451,7 +402,7 @@ public function hasMemo(){
* @return \payments\PaymentDetails
*/
public function clearMemo(){
return $this->_clear(6);
return $this->_clear(5);
}

/**
Expand All @@ -460,7 +411,7 @@ public function clearMemo(){
* @return string
*/
public function getMemo(){
return $this->_get(6);
return $this->_get(5);
}

/**
Expand All @@ -470,7 +421,7 @@ public function getMemo(){
* @return \payments\PaymentDetails
*/
public function setMemo( $value){
return $this->_set(6, $value);
return $this->_set(5, $value);
}

/**
Expand All @@ -479,7 +430,7 @@ public function setMemo( $value){
* @return boolean
*/
public function hasPaymentUrl(){
return $this->_has(7);
return $this->_has(6);
}

/**
Expand All @@ -488,7 +439,7 @@ public function hasPaymentUrl(){
* @return \payments\PaymentDetails
*/
public function clearPaymentUrl(){
return $this->_clear(7);
return $this->_clear(6);
}

/**
Expand All @@ -497,7 +448,7 @@ public function clearPaymentUrl(){
* @return string
*/
public function getPaymentUrl(){
return $this->_get(7);
return $this->_get(6);
}

/**
Expand All @@ -507,7 +458,7 @@ public function getPaymentUrl(){
* @return \payments\PaymentDetails
*/
public function setPaymentUrl( $value){
return $this->_set(7, $value);
return $this->_set(6, $value);
}

/**
Expand All @@ -516,7 +467,7 @@ public function setPaymentUrl( $value){
* @return boolean
*/
public function hasMerchantData(){
return $this->_has(8);
return $this->_has(7);
}

/**
Expand All @@ -525,7 +476,7 @@ public function hasMerchantData(){
* @return \payments\PaymentDetails
*/
public function clearMerchantData(){
return $this->_clear(8);
return $this->_clear(7);
}

/**
Expand All @@ -534,7 +485,7 @@ public function clearMerchantData(){
* @return string
*/
public function getMerchantData(){
return $this->_get(8);
return $this->_get(7);
}

/**
Expand All @@ -544,7 +495,7 @@ public function getMerchantData(){
* @return \payments\PaymentDetails
*/
public function setMerchantData( $value){
return $this->_set(8, $value);
return $this->_set(7, $value);
}
}
}
Expand Down Expand Up @@ -1162,9 +1113,6 @@ class PaymentACK extends \DrSlump\Protobuf\Message {
/** @var \payments\Payment */
public $payment = null;

/** @var boolean */
public $accepted = null;

/** @var string */
public $memo = null;

Expand All @@ -1185,17 +1133,9 @@ public static function descriptor()
$f->reference = '\payments\Payment';
$descriptor->addField($f);

// REQUIRED BOOL accepted = 2
// OPTIONAL STRING memo = 2
$f = new \DrSlump\Protobuf\Field();
$f->number = 2;
$f->name = "accepted";
$f->type = \DrSlump\Protobuf::TYPE_BOOL;
$f->rule = \DrSlump\Protobuf::RULE_REQUIRED;
$descriptor->addField($f);

// OPTIONAL STRING memo = 3
$f = new \DrSlump\Protobuf\Field();
$f->number = 3;
$f->name = "memo";
$f->type = \DrSlump\Protobuf::TYPE_STRING;
$f->rule = \DrSlump\Protobuf::RULE_OPTIONAL;
Expand Down Expand Up @@ -1245,50 +1185,13 @@ public function setPayment(\payments\Payment $value){
return $this->_set(1, $value);
}

/**
* Check if <accepted> has a value
*
* @return boolean
*/
public function hasAccepted(){
return $this->_has(2);
}

/**
* Clear <accepted> value
*
* @return \payments\PaymentACK
*/
public function clearAccepted(){
return $this->_clear(2);
}

/**
* Get <accepted> value
*
* @return boolean
*/
public function getAccepted(){
return $this->_get(2);
}

/**
* Set <accepted> value
*
* @param boolean $value
* @return \payments\PaymentACK
*/
public function setAccepted( $value){
return $this->_set(2, $value);
}

/**
* Check if <memo> has a value
*
* @return boolean
*/
public function hasMemo(){
return $this->_has(3);
return $this->_has(2);
}

/**
Expand All @@ -1297,7 +1200,7 @@ public function hasMemo(){
* @return \payments\PaymentACK
*/
public function clearMemo(){
return $this->_clear(3);
return $this->_clear(2);
}

/**
Expand All @@ -1306,7 +1209,7 @@ public function clearMemo(){
* @return string
*/
public function getMemo(){
return $this->_get(3);
return $this->_get(2);
}

/**
Expand All @@ -1316,7 +1219,7 @@ public function getMemo(){
* @return \payments\PaymentACK
*/
public function setMemo( $value){
return $this->_set(3, $value);
return $this->_set(2, $value);
}
}
}
Expand Down
Loading

0 comments on commit c70b18b

Please sign in to comment.