syntax = "proto3";

package wix.payment.api.pay.v2;

import "google/api/annotations.proto";
import "wix/payment/api/pay/v2/resources/pos-transaction.proto";
import "wix/api/entity.proto";

option java_package = "com.wix.payment.api.pay.v2";

service PosTransactionService {

    option (wix.api.service_entity).message = "wix.payment.api.pay.v2.PosTransaction";

    // creates transaction from PoS terminal
    rpc Create(CreatePosTransactionRequest) returns (CreatePosTransactionResponse) {
        option (google.api.http) = {
            post: "/api/payments/v2/charges/{charge_id}/pos"
        };
    };
}

message CreatePosTransactionRequest {
    // charge id which was payed through PoS terminal
    string charge_id             = 1;

    // transaction details
    PosTransaction transaction  = 2;
}

message CreatePosTransactionResponse {
    // id of created transaction
    string transaction_id   = 1;
}
