charitable
/
vendor
/
square
/
square
/
src
/
Legacy
/
Models
/
Builders
/
CreatePaymentLinkRequestBuilder.php
CreatePaymentLinkRequestBuilder.php in Charitable – Donation & Fundraising Platform (Donation Forms, Recurring Donations & Fundraising Campaigns) 1.8.13, at vendor/square/square/src/Legacy/Models/Builders/CreatePaymentLinkRequestBuilder.php
| 1 | <?php |
| 2 | |
| 3 | declare(strict_types=1); |
| 4 | |
| 5 | namespace Square\Legacy\Models\Builders; |
| 6 | |
| 7 | use Core\Utils\CoreHelper; |
| 8 | use Square\Legacy\Models\CheckoutOptions; |
| 9 | use Square\Legacy\Models\CreatePaymentLinkRequest; |
| 10 | use Square\Legacy\Models\Order; |
| 11 | use Square\Legacy\Models\PrePopulatedData; |
| 12 | use Square\Legacy\Models\QuickPay; |
| 13 | |
| 14 | /** |
| 15 | * Builder for model CreatePaymentLinkRequest |
| 16 | * |
| 17 | * @see CreatePaymentLinkRequest |
| 18 | */ |
| 19 | class CreatePaymentLinkRequestBuilder |
| 20 | { |
| 21 | /** |
| 22 | * @var CreatePaymentLinkRequest |
| 23 | */ |
| 24 | private $instance; |
| 25 | |
| 26 | private function __construct(CreatePaymentLinkRequest $instance) |
| 27 | { |
| 28 | $this->instance = $instance; |
| 29 | } |
| 30 | |
| 31 | /** |
| 32 | * Initializes a new Create Payment Link Request Builder object. |
| 33 | */ |
| 34 | public static function init(): self |
| 35 | { |
| 36 | return new self(new CreatePaymentLinkRequest()); |
| 37 | } |
| 38 | |
| 39 | /** |
| 40 | * Sets idempotency key field. |
| 41 | * |
| 42 | * @param string|null $value |
| 43 | */ |
| 44 | public function idempotencyKey(?string $value): self |
| 45 | { |
| 46 | $this->instance->setIdempotencyKey($value); |
| 47 | return $this; |
| 48 | } |
| 49 | |
| 50 | /** |
| 51 | * Sets description field. |
| 52 | * |
| 53 | * @param string|null $value |
| 54 | */ |
| 55 | public function description(?string $value): self |
| 56 | { |
| 57 | $this->instance->setDescription($value); |
| 58 | return $this; |
| 59 | } |
| 60 | |
| 61 | /** |
| 62 | * Sets quick pay field. |
| 63 | * |
| 64 | * @param QuickPay|null $value |
| 65 | */ |
| 66 | public function quickPay(?QuickPay $value): self |
| 67 | { |
| 68 | $this->instance->setQuickPay($value); |
| 69 | return $this; |
| 70 | } |
| 71 | |
| 72 | /** |
| 73 | * Sets order field. |
| 74 | * |
| 75 | * @param Order|null $value |
| 76 | */ |
| 77 | public function order(?Order $value): self |
| 78 | { |
| 79 | $this->instance->setOrder($value); |
| 80 | return $this; |
| 81 | } |
| 82 | |
| 83 | /** |
| 84 | * Sets checkout options field. |
| 85 | * |
| 86 | * @param CheckoutOptions|null $value |
| 87 | */ |
| 88 | public function checkoutOptions(?CheckoutOptions $value): self |
| 89 | { |
| 90 | $this->instance->setCheckoutOptions($value); |
| 91 | return $this; |
| 92 | } |
| 93 | |
| 94 | /** |
| 95 | * Sets pre populated data field. |
| 96 | * |
| 97 | * @param PrePopulatedData|null $value |
| 98 | */ |
| 99 | public function prePopulatedData(?PrePopulatedData $value): self |
| 100 | { |
| 101 | $this->instance->setPrePopulatedData($value); |
| 102 | return $this; |
| 103 | } |
| 104 | |
| 105 | /** |
| 106 | * Sets payment note field. |
| 107 | * |
| 108 | * @param string|null $value |
| 109 | */ |
| 110 | public function paymentNote(?string $value): self |
| 111 | { |
| 112 | $this->instance->setPaymentNote($value); |
| 113 | return $this; |
| 114 | } |
| 115 | |
| 116 | /** |
| 117 | * Initializes a new Create Payment Link Request object. |
| 118 | */ |
| 119 | public function build(): CreatePaymentLinkRequest |
| 120 | { |
| 121 | return CoreHelper::clone($this->instance); |
| 122 | } |
| 123 | } |
| 124 |