예제 #1
0
        public GiftCardAddValueResponse GiftCardAddValue(string accessToken, int merchantId, int locationId, string giftCardQrData,
                                                         int valueToAddInCents, string identifierFromMerchant, IList <string> tenderTypes = null, string levelUpOrderId = null)
        {
            var requestBody = new GiftCardAddValueRequestBody(giftCardQrData, valueToAddInCents, locationId,
                                                              identifierFromMerchant, tenderTypes, levelUpOrderId);

            return(GiftCardAddValue(accessToken, merchantId, requestBody));
        }
        public void SerializeDeserialize_GiftCardAddValue()
        {
            GiftCardAddValueRequestBody gcAdd = new GiftCardAddValueRequestBody("LU0123TestPaymentTokenData3210LU",
                                                                                10,
                                                                                123,
                                                                                "ATestThisIs",
                                                                                new List <string>()
            {
                "Cash",
                "Credit - Visa",
                "Cheque",
                "LevelUp",
                "LevelUp",
                "Barter"
            },
                                                                                "abc1234567890def");

            GiftCardAddValueRequestBody deserialized = TestUtilities.SerializeThenDeserialize <GiftCardAddValueRequestBody>(gcAdd);

            Assert.IsNotNull(deserialized);
            Assert.IsTrue(TestUtilities.PublicPropertiesAreEqual(gcAdd, deserialized));
        }
 public GiftCardAddValueResponse GiftCardAddValue(string accessToken, int merchantId, GiftCardAddValueRequestBody addValueRequest)
 {
     return(GiftCardAddValue(accessToken, merchantId, addValueRequest.LocationId, addValueRequest.GiftCardQrData, addValueRequest.AmountInCents,
                             addValueRequest.IdentifierFromMerchant, addValueRequest.TenderTypes, addValueRequest.AssociatedLevelUpOrderId));
 }
예제 #4
0
        public GiftCardAddValueResponse GiftCardAddValue(string accessToken, int merchantId, GiftCardAddValueRequestBody addValueRequest)
        {
            GiftCardAddValueRequest request = new GiftCardAddValueRequest(accessToken, merchantId, addValueRequest);

            return(_restWrapper.Post <GiftCardAddValueRequestBody, GiftCardAddValueResponse>(
                       request.Body,
                       uri: BuildUri(request.ApiVersion, $"merchants/{request.MerchantId}/gift_card_value_additions"),
                       accessTokenHeader: FormatAccessTokenString(unspecifiedUserAccessToken: request.AccessToken),
                       actions: null));
        }