I am unable to store phone number to either an ARB or CIM profile. Everything else stores perfect, but phone number won't save. We tried '1111111111' as well. Is :phone not the correct option name? Authorize.net has a field for phone number.
We are using the recurring in ARB:
http://activemerchant.rubyforge.org/classes/ActiveMerchant/Billing/AuthorizeNetGateway.html#M000399
options = {
:billing_address => {
:name => 'Mark McBride',
:address1 => '1 Show Me The Money Lane',
:city => 'San Francisco',
:state => 'CA',
:country => 'US',
:zip => '23456',
:phone => '(555)555-5555'
}
}
Any help would be amazing.
You have phone number in the wrong place. Phone number goes under "customer". Not the billing information. Make sure to read the documentation for the proper syntax for each request.
Sorry delphi but you cannot pass phone number in billing address.
Related
I am trying to charge for Authorize .net Gateway using active merchant gem.
Here is the link for gem
- https://github.com/activemerchant/active_merchant
I am sending email,invoice,description,billing_address, shipping_address as option parameter and transaction is successfully done also but when I see the transaction detail, I found every parameter on authorize .net other than invoice number.
here is my code for option -
options = {:email => "sunil#gmail.com",:invoice => "INV-12345",:description => "Amount 50 for INV-12345",:billing_address => { :name => "Sunil Kumar", :address1 => "9888 America Ave. NW",:city => "Oakland", :state => "AK",
:country => "United States", :zip => "94605",:phone => "1234567890"}}
While charging we are using below code -
gateway.purchase((amount*100), creditcard,options)
Now after successful transaction when I see the transaction detail I found every thing other than Invoice#.
Please suggest if any thing left.
You need to change invoice to order_id. so your code would look like.
options = {:email => "sunil#gmail.com",:order_id => "INV-12345",:description => "Amount 50 for INV-12345",:billing_address => { :name => "Sunil Kumar", :address1 => "9888 America Ave. NW",:city => "Oakland", :state => "AK",
:country => "United States", :zip => "94605",:phone => "1234567890"}}
Here is the code from ActiveMerchant.
def add_invoice(xml, options)
xml.order do
xml.invoiceNumber(truncate(options[:order_id], 20))
xml.description(truncate(options[:description], 255))
end
# Authorize.net API requires lineItems to be placed directly after order tag
if options[:line_items]
xml.lineItems do
options[:line_items].each do |line_item|
xml.lineItem do
line_item.each do |key, value|
xml.send(camel_case_lower(key), value)
end
end
end
end
end
end
https://github.com/activemerchant/active_merchant/blob/master/lib/active_merchant/billing/gateways/authorize_net.rb
I'm trying to create ups shipping using active_shpping gem. I'm not sure if i'm doing everything properly but every time I try to create shipment i got Runtime Error Could not obtain shipping label. Missing or invalid shipper name.. In order to reproduce this problem:
packages = [
ActiveMerchant::Shipping::Package.new( 100, [93,10]),
ActiveMerchant::Shipping::Package.new( 100, [93,10])
]
origin = ActiveMerchant::Shipping::Location.new( :country => 'US', :state => 'CA', :city => 'Beverly Hills', :zip => '90210', :name => 'random name')
destination = ActiveMerchant::Shipping::Location.new( :country => 'CA', :province => 'ON', :city => 'Ottawa', :postal_code => 'K1P 1J1')
ups = ActiveMerchant::Shipping::UPS.new(:login => 'my-working-login', :password => 'my-working-password', :key => 'my-working-ups-key')
ups.create_shipment(origin, destination, packages)
Am I missing any parameter? Or perhaps creating shippment via UPS is unsupported?
I am using PayPal adaptive payment. I want to send shipping address of sender to reciever.
I am doing following things
First I am getting the approval key from sender with Preapproval API
Then, i am using PAY Create API.
This are the paramters
:actionType => "CREATE",
cancelUrl: 'https://www.example.com/paypal_cancelurl',
returnUrl: 'https://www.example.com/paypal_successurl',
:currencyCode => "USD",
:preapprovalKey => preapproval_key,
:receiverList => {
:receiver => [{
:amount => total,
:email => reciever#example.com }] }
After getting paypal paykey from step 2, i am using Set Payment Option API . I am passing following information
:payKey => paykey,
:displayOptions => {
:businessName => "Example Site" },
:senderOptions => {
:shippingAddress => {
:addresseeName => sender_name
:street1 => sender_street,
:city => sender_city,
:state => sender_state,
:zip => sender_zip,
:country => "US"
}
}
Lastly, I am executing payment with Execute Pay API.
Everything is fine but when reciever review this payment in paypal screen, he don't see the shipping address which i sent to him. His paypal screen say that the sender has no shipping address.
I cross checked, fetched the Payment Details with Payment Details API, found that shipping address is there, strange?
What i am missing, why shipping address is not visible in paypal screen.?
Update: all above flow is done on sandbox.I'm not sure this matters but thought to mention it.
The shipping options would have to work in the embedded payment flow, your request payload looks fine, and you would just need to modify the redirection codes with JS lightbox or minibrowers, as per this instruction: How to Create an Embedded Payment Flow Using Adaptive Payments
I'm currently developing a Rails application to accept recurring billing using Chargify. I've installed their gem and managed to connect to Chargify with the gem. However, some subscriptions go through and some do not.
My question is how do I handle or even process the response once the gem communicates with the server?
I don't see anything in the development logs that gives me any indication of a successful data transfer or a failed one. The gem documentation also does not mention anything regarding this.
Thanks for looking.
UPDATE
The code I'm playing around with is in my checkout controller:
def checkout
#customer = Customer.new(params[:customer])
Chargify::Customer.create(
:first_name => "Charlie",
:last_name => "Bull",
:email => "charlie#example.com",
:organization => "Chargify"
)
Chargify::Subscription.create(
:product_handle => 'recurring',
:customer_attriburtes => {
:first_name => #customer.shipping_first_name,
:last_name => #customer.shipping_last_name,
:email => #customer.email
},
:payment_profile_attributes => {
:first_name => #customer.shipping_first_name,
:last_name => #customer.shipping_last_name,
:full_number => "1",
:expiration_month => 1,
:expiration_year => 2012,
:billing_address => #customer.shipping_street_address,
:billing_city => #customer.shipping_city,
:billing_state => #customer.shipping_state,
:billing_zip => #customer.shipping_zip_code,
:billing_country => #customer.shipping_country
}
)
#if #subscription.save
# logger.info "saved description"
# redirect_to process_path
#else
# redirect_to :back, :alert =>"There was an error."
#end
end
The customer create is going through, but the Subscription does not. I'm just looking for a callback from the server so I can act based off whether it succeeded and find out why the subscription isn't going through.
Since this whole gem uses ActiveResource cant you just call something like:
# Create a subscription from a customer reference
subscription = Chargify::Subscription.create(
:customer_reference => 'moklett',
:product_handle => 'chargify-api-ares-test',
:credit_card_attributes => {
:first_name => "Michael",
:last_name => "Klett",
:expiration_month => 1,
:expiration_year => 2020,
:full_number => "1"
}
)
if subscription.save
puts "Created Subscription!"
else
puts "Subscription Failed!"
end
and see if the record has been created correctly?
EDIT: Your code should work but I see that the call to save is commented out. When you call save it creates or updates the record and testing this should allow you to determine if your record was created or not.
I am making the paypal application with rails.
I have create all the necessary a/c in http://develpers.paypal.com and also have insert all that information in my rails app.
My problem is when i am trying to authorize my seller a/c, it gives me error like
"Failure: This transaction cannot be processed due to an invalid merchant configuration."
My code is:
# all inforation is of seller API id, password, signature
gateway = ActiveMerchant::Billing::PaypalGateway.new(
:login => "seller_1302505219_biz_api1.gmail.com",
:password => "...",
:signature => "..."
)
options = {
:ip => request.remote_ip,
:billing_address => {
:name => "Name",
:address1 => '1 Main St',
:address2 => '',
:city => 'San Jose',
:state => 'CA',
:country => 'US',
:zip => '95131',
# :phone => '408-983-5678'
:phone => '408-678-0945'
}
}
res = gateway.authorize(amount, credit_card, options)
You need to have a seller account set up with Website Payments Pro.
Create your selling test account using the Preconfigured option.
Under Account Type, select Website Payments Pro.
Good luck!
Got the solution.
I have google it but got the information about the "Billing agreement".
But that functionality is provided in Website Payment Pro.
so I have just create an test account using WPP and use that WPP account credential for transaction.
It works fine.
Cheers!!!
In addition, your account may or may not be enabled for Pro (DoDirectPayment) even after signing up for it in Sandbox. There's a thread on the x.com forums where you can ask one of the support guys to enable it for you.