regis

<back to all web services

BeanstreamCreditCardTokenPaymentRequest

Requires Authentication
Required role:REGISUserRole
The following routes are available for this service:
POST/Beanstream/Payment/{uuid}/CreditCard/Token/Create
<?php namespace dtos;

use DateTime;
use Exception;
use DateInterval;
use JsonSerializable;
use ServiceStack\{IReturn,IReturnVoid,IGet,IPost,IPut,IDelete,IPatch,IMeta,IHasSessionId,IHasBearerToken,IHasVersion};
use ServiceStack\{ICrud,ICreateDb,IUpdateDb,IPatchDb,IDeleteDb,ISaveDb,AuditBase,QueryDb,QueryDb2,QueryData,QueryData2,QueryResponse};
use ServiceStack\{ResponseStatus,ResponseError,EmptyResponse,IdResponse,ArrayList,KeyValuePair2,StringResponse,StringsResponse,Tuple2,Tuple3,ByteArray};
use ServiceStack\{JsonConverters,Returns,TypeContext};


class BeanstreamCreditCardCompletionResponse implements JsonSerializable
{
    public function __construct(
        /** @var string|null */
        public ?string $uuid=null,
        /** @var string|null */
        public ?string $id=null,
        /** @var bool|null */
        public ?bool $approved=null,
        /** @var string|null */
        public ?string $message_id=null,
        /** @var string|null */
        public ?string $message=null,
        /** @var string|null */
        public ?string $order_number=null,
        /** @var string|null */
        public ?string $payment_method=null,
        /** @var string|null */
        public ?string $card_type=null,
        /** @var string|null */
        public ?string $card_last_four=null
    ) {
    }

    /** @throws Exception */
    public function fromMap($o): void {
        if (isset($o['uuid'])) $this->uuid = $o['uuid'];
        if (isset($o['id'])) $this->id = $o['id'];
        if (isset($o['approved'])) $this->approved = $o['approved'];
        if (isset($o['message_id'])) $this->message_id = $o['message_id'];
        if (isset($o['message'])) $this->message = $o['message'];
        if (isset($o['order_number'])) $this->order_number = $o['order_number'];
        if (isset($o['payment_method'])) $this->payment_method = $o['payment_method'];
        if (isset($o['card_type'])) $this->card_type = $o['card_type'];
        if (isset($o['card_last_four'])) $this->card_last_four = $o['card_last_four'];
    }
    
    /** @throws Exception */
    public function jsonSerialize(): mixed
    {
        $o = [];
        if (isset($this->uuid)) $o['uuid'] = $this->uuid;
        if (isset($this->id)) $o['id'] = $this->id;
        if (isset($this->approved)) $o['approved'] = $this->approved;
        if (isset($this->message_id)) $o['message_id'] = $this->message_id;
        if (isset($this->message)) $o['message'] = $this->message;
        if (isset($this->order_number)) $o['order_number'] = $this->order_number;
        if (isset($this->payment_method)) $o['payment_method'] = $this->payment_method;
        if (isset($this->card_type)) $o['card_type'] = $this->card_type;
        if (isset($this->card_last_four)) $o['card_last_four'] = $this->card_last_four;
        return empty($o) ? new class(){} : $o;
    }
}

class BeanstreamCreditCardTokenPaymentRequest implements JsonSerializable
{
    public function __construct(
        /** @var string|null */
        public ?string $uuid=null,
        /** @var string|null */
        public ?string $department=null,
        /** @var string|null */
        public ?string $item=null,
        /** @var float */
        public float $amount=0.0,
        /** @var string|null */
        public ?string $name=null,
        /** @var string|null */
        public ?string $customer_ip=null,
        /** @var string|null */
        public ?string $email=null,
        /** @var string|null */
        public ?string $addr1=null,
        /** @var string|null */
        public ?string $addr2=null,
        /** @var string|null */
        public ?string $city=null,
        /** @var string|null */
        public ?string $state=null,
        /** @var string|null */
        public ?string $country=null,
        /** @var string|null */
        public ?string $code=null,
        /** @var string|null */
        public ?string $phone=null,
        /** @var string|null */
        public ?string $token=null,
        /** @var string|null */
        public ?string $card_type=null,
        /** @var string|null */
        public ?string $token_last_four=null,
        /** @var string|null */
        public ?string $card_name=null
    ) {
    }

    /** @throws Exception */
    public function fromMap($o): void {
        if (isset($o['uuid'])) $this->uuid = $o['uuid'];
        if (isset($o['department'])) $this->department = $o['department'];
        if (isset($o['item'])) $this->item = $o['item'];
        if (isset($o['amount'])) $this->amount = $o['amount'];
        if (isset($o['name'])) $this->name = $o['name'];
        if (isset($o['customer_ip'])) $this->customer_ip = $o['customer_ip'];
        if (isset($o['email'])) $this->email = $o['email'];
        if (isset($o['addr1'])) $this->addr1 = $o['addr1'];
        if (isset($o['addr2'])) $this->addr2 = $o['addr2'];
        if (isset($o['city'])) $this->city = $o['city'];
        if (isset($o['state'])) $this->state = $o['state'];
        if (isset($o['country'])) $this->country = $o['country'];
        if (isset($o['code'])) $this->code = $o['code'];
        if (isset($o['phone'])) $this->phone = $o['phone'];
        if (isset($o['token'])) $this->token = $o['token'];
        if (isset($o['card_type'])) $this->card_type = $o['card_type'];
        if (isset($o['token_last_four'])) $this->token_last_four = $o['token_last_four'];
        if (isset($o['card_name'])) $this->card_name = $o['card_name'];
    }
    
    /** @throws Exception */
    public function jsonSerialize(): mixed
    {
        $o = [];
        if (isset($this->uuid)) $o['uuid'] = $this->uuid;
        if (isset($this->department)) $o['department'] = $this->department;
        if (isset($this->item)) $o['item'] = $this->item;
        if (isset($this->amount)) $o['amount'] = $this->amount;
        if (isset($this->name)) $o['name'] = $this->name;
        if (isset($this->customer_ip)) $o['customer_ip'] = $this->customer_ip;
        if (isset($this->email)) $o['email'] = $this->email;
        if (isset($this->addr1)) $o['addr1'] = $this->addr1;
        if (isset($this->addr2)) $o['addr2'] = $this->addr2;
        if (isset($this->city)) $o['city'] = $this->city;
        if (isset($this->state)) $o['state'] = $this->state;
        if (isset($this->country)) $o['country'] = $this->country;
        if (isset($this->code)) $o['code'] = $this->code;
        if (isset($this->phone)) $o['phone'] = $this->phone;
        if (isset($this->token)) $o['token'] = $this->token;
        if (isset($this->card_type)) $o['card_type'] = $this->card_type;
        if (isset($this->token_last_four)) $o['token_last_four'] = $this->token_last_four;
        if (isset($this->card_name)) $o['card_name'] = $this->card_name;
        return empty($o) ? new class(){} : $o;
    }
}

PHP BeanstreamCreditCardTokenPaymentRequest DTOs

To override the Content-type in your clients, use the HTTP Accept Header, append the .other suffix or ?format=other

HTTP + OTHER

The following are sample HTTP requests and responses. The placeholders shown need to be replaced with actual values.

POST /Beanstream/Payment/{uuid}/CreditCard/Token/Create HTTP/1.1 
Host: data.regent-college.edu 
Accept: text/jsonl
Content-Type: text/jsonl
Content-Length: length

{"uuid":"String","department":"String","item":"String","amount":0,"name":"String","customer_ip":"String","email":"String","addr1":"String","addr2":"String","city":"String","state":"String","country":"String","code":"String","phone":"String","token":"String","card_type":"String","token_last_four":"String","card_name":"String"}
HTTP/1.1 200 OK
Content-Type: text/jsonl
Content-Length: length

{"uuid":"String","id":"String","approved":false,"message_id":"String","message":"String","order_number":"String","payment_method":"String","card_type":"String","card_last_four":"String"}