Skip to content

Commit be3209f

Browse files
committed
Randomized names
1 parent e722dcd commit be3209f

File tree

2 files changed

+7
-8
lines changed

2 files changed

+7
-8
lines changed

CustomerProfiles/create-customer-payment-profile.rb

+4-4
Original file line numberDiff line numberDiff line change
@@ -16,8 +16,8 @@ def create_customer_payment_profile(customerProfileId = '1813343337')
1616

1717
# Build an address object
1818
billTo = CustomerAddressType.new
19-
billTo.firstName = "Jerry"
20-
billTo.lastName = "Johnson"
19+
billTo.firstName = "Jerry" + (0...8).map { (65 + rand(26)).chr }.join
20+
billTo.lastName = "Johnson" + (0...8).map { (65 + rand(26)).chr }.join
2121
billTo.company = "Souveniropolis"
2222
billTo.address = "14 Main Street"
2323
billTo.city = "Pecan Springs"
@@ -38,15 +38,15 @@ def create_customer_payment_profile(customerProfileId = '1813343337')
3838
request = CreateCustomerPaymentProfileRequest.new
3939
request.paymentProfile = paymentProfile
4040
request.customerProfileId = customerProfileId
41-
request.validationMode = ValidationModeEnum::LiveMode
41+
request.validationMode = ValidationModeEnum::LiveMode
4242

4343
response = transaction.create_customer_payment_profile(request)
4444

4545
if response != nil
4646
if response.messages.resultCode == MessageTypeEnum::Ok
4747
puts "Successfully created a customer payment profile with id: #{response.customerPaymentProfileId}."
4848
else
49-
puts response.messages.messages[0].code
49+
puts response.messages.messages[0].code
5050
puts response.messages.messages[0].text
5151
puts "Failed to create a new customer payment profile."
5252
end

CustomerProfiles/create-customer-shipping-address.rb

+3-4
Original file line numberDiff line numberDiff line change
@@ -10,18 +10,17 @@ def create_customer_shipping_address(customerProfileId = '1813343337')
1010

1111
transaction = Transaction.new(config['api_login_id'], config['api_transaction_key'], :gateway => :sandbox)
1212

13-
13+
1414
request = CreateCustomerShippingAddressRequest.new
15-
15+
1616
request.address = CustomerAddressType.new('John','Doe')
1717
request.customerProfileId = customerProfileId
1818
response = transaction.create_customer_shipping_profile(request)
1919

20-
2120
if response.messages.resultCode == MessageTypeEnum::Ok
2221
puts "Successfully created a customer shipping address with id: #{response.customerAddressId}."
2322
else
24-
puts "Failed to create a new customer shipping address: #{response.messages.messages[0].text}"
23+
puts "Failed to create a new customer shipping address: #{response.messages.messages[0].text}"
2524
end
2625
return response
2726
end

0 commit comments

Comments
 (0)