Description Usage Arguments Value Examples
View source: R/func_send-payment.R
The most likely reason to use the tremendousr package is to send rewards
This function, trem_send_reward()
, provides an easy interface to do so. See the
examples for more details.
1 2 3 4 5 6 7 8 9 10 11 12 13 |
client |
A Tremendous API Client object, created with
|
name |
Name of the recipient. |
email |
Email address of the recipient. |
phone |
Phone number of the recipient (US phone numbers only). |
reward_amount |
Amount of the reward (numeric). |
currency_code |
Currency of the reward (default to "USD"). |
delivery_method |
Default to "EMAIL", for sending the reward to the recipient via email. Alternatively, reward can be delivered via a link ("LINK") or text message ("PHONE"). |
payment_description_id |
Unique ID for specific order. This will appear
as |
funding_source_id |
ID of the funding source linked to your account, to
draw funds from for this order. One of the IDs from
|
reward_types |
A character vector of product ids – reward options – for the recipient to choose from. Available options can be found here. |
parse |
Logical: Should the API Response results be parsed into a data frame? |
If parse = TRUE
(default), a list containing the response
from payment API request. Otherwise, the R6 HttpResponse object containing
API request data.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 | ## Not run:
# Create a Tremendous Client
test_client <- trem_client_new(api_key = "TEST_YOUR-KEY-HERE",
sandbox = TRUE) # Sandbox environment so no actual money is sent
# To send a payment, you can simply pass in the client
# and specify the necessary fields.
payment1 <- trem_send_reward(client = test_client,
name = "first last",
email = "email@website.com",
reward_amount = 10,
currency_code = "USD",
delivery_method = "EMAIL",
payment_description_id = "payment-from-tremendousr-examples",
funding_source_id = "your-funding-id-from-tremendous",
reward_types = "Q24BD9EZ332JT", # ID for virtual visa gift card
parse = TRUE # Return a parsed API response
)
## End(Not run)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.