pub struct CreateGiftCardRequest {
pub idempotency_key: String,
pub location_id: String,
pub gift_card: GiftCard,
}
Expand description
This is a model struct for CreateGiftCardRequest type
Fields§
§idempotency_key: String
A unique identifier for this request, used to ensure idempotency. For more information, see Idempotency.
Min Length: 1, Max Length: 128
location_id: String
The ID of the [Location] where the gift card should be registered for reporting purposes. Gift cards can be redeemed at any of the seller’s locations.
Min Length: 1
gift_card: GiftCard
The gift card to create. The type
field is required for this request. The gan_source
and
gan
fields are included as follows:
To direct Square to generate a 16-digit GAN, omit gan_source
and gan
.
To provide a custom GAN, include gan_source
and gan
.
- For
gan_source
, specifyOTHER
. - For
gan
, provide a custom GAN containing 8 to 20 alphanumeric characters. The GAN must be unique for the seller and cannot start with the same bank identification number (BIN) as major credit cards. Do not use GANs that are easy to guess (such as 12345678) because they greatly increase the risk of fraud. It is the responsibility of the developer to ensure the security of their custom GANs. For more information, see Custom GANs.
To register an unused, physical gift card that the seller previously ordered from Square,
include gan
and provide the GAN that is printed on the gift card.
Trait Implementations§
Source§impl Clone for CreateGiftCardRequest
impl Clone for CreateGiftCardRequest
Source§fn clone(&self) -> CreateGiftCardRequest
fn clone(&self) -> CreateGiftCardRequest
1.0.0 · Source§const fn clone_from(&mut self, source: &Self)
const fn clone_from(&mut self, source: &Self)
source
. Read moreSource§impl Debug for CreateGiftCardRequest
impl Debug for CreateGiftCardRequest
Source§impl Default for CreateGiftCardRequest
impl Default for CreateGiftCardRequest
Source§fn default() -> CreateGiftCardRequest
fn default() -> CreateGiftCardRequest
Source§impl PartialEq for CreateGiftCardRequest
impl PartialEq for CreateGiftCardRequest
Source§impl Serialize for CreateGiftCardRequest
impl Serialize for CreateGiftCardRequest
impl Eq for CreateGiftCardRequest
impl StructuralPartialEq for CreateGiftCardRequest
Auto Trait Implementations§
impl Freeze for CreateGiftCardRequest
impl RefUnwindSafe for CreateGiftCardRequest
impl Send for CreateGiftCardRequest
impl Sync for CreateGiftCardRequest
impl Unpin for CreateGiftCardRequest
impl UnwindSafe for CreateGiftCardRequest
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key
and return true
if they are equal.