shipping address is not visible in paypal screen while using adaptive payment - ruby-on-rails

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

Related

PayPal adaptive payments ipnNotificationUrl is not getting hit for app/facilitator

I am creating the following pay request with the ruby adaptive payment sdk:
fee = 2
api = PayPal::SDK::AdaptivePayments.new
pay = api.build_pay({
:actionType => "PAY",
:cancelUrl => "https://localhost:3000/purchases/paypal_cancelled?purchase_guid=" + self.guid,
:currencyCode => self.currency,
:feesPayer => "PRIMARYRECEIVER",
:ipnNotificationUrl => "http://paypal.corstiaan.ultrahook.com/purchases/paypal_ipn_notify?purchase_guid=" + self.guid,
:receiverList => {
:receiver => [{
:amount => 20,
:email => seller#email.com,
:primary => true
}, {
:amount => fee,
:email => 'ch-facilitator#corstiaan.com'
}],
},
:returnUrl => "https://localhost:3000/purchases/paypal_success?purchase_guid=" + self.guid + "&verification_key=" + paypal_verification_key })
pay_response = api.pay(pay)
Everything works just like I want it to. I am the facilitator of the transaction and secondary receiver and the seller is the primary receiver. This is all ok. Also, the cancel and return urls are being called correctly.
Only the ipnNotificationUrl is not getting hit. I have set up a forward using ultrahook.com which is getting called correctly when using paypal's ipn simulator (that does not support adaptive ipn messages for some reason...) so technically that forward should work, but I never see anything hitting my server...
I am lost in the paypal docs, which are terrible.
When I view the IPN history ch-facilitator#corstiaan.com I only see IPN messages that relate to the payment of the fee from the seller to facilitator, nothing regarding the whole transaction which should be posted to ipnNotificationUrl if I understand correctly up to this point.
What am I doing wrong/what can be the problem? Thanks!

How to charge a particular card on a customer with Stripe.com

A customer object can have many cards in Stripe.com. How do you charge an existing card?
I've tried a few things, but the stripe api for some reason borks when to get an old customer token and a new card token instead of just creating a new card on that customer. So I've gone the route of retrieving all the customer's cards, then selecting one by radio button, then submitting the token of the chosen card into a charge
charge = Stripe::Charge.create(
:amount => "#{#subscription.price}",
:currency => "usd",
:card => params[:existing_card_id],
:description => "Subscription for #{current_user.email}"
)
but I get the error
Stripe::InvalidRequestError: Invalid token id: card_24j3i2390s9df
I figured this out.
With existing card tokens you have to send in the customer token as well
charge = Stripe::Charge.create(
:amount => "#{#subscription.price}",
:currency => "usd",
:customer => current_user.stripe_customer_id,
:card => params[:existing_card_id],
:description => "Subscription for #{current_user.email}"
)
This answer help to ME apply the same solution in PHP for charge an specific credit card customer, other than the default credit card. Here the pieces:
JSON:
{
"charge": {
"amount":122,
"currency":"usd",
"customer":"cus_7hVsgytCc79BL7",
"card":"card_17SENFJ4sx1xVfmD8skoSjNs"
}
}
PHP
$item = $params->request->getJsonRawBody();
$new_charge = \Stripe\Charge::create(array(
"amount" => $this->ConvertAmount($item->charge->amount),
"currency" => $item->charge->currency,
"customer" => $item->charge->customer,
"card" => $item->charge->card
));
return $new_charge;

Setting business name and header images with adaptive payments on paypal

In order to ensure consistent experience i want to set header image and business on paypal's page, view items with their names and description and ask the customer to select shipping address.
I'm using active_paypal_adaptive_payment gem (https://github.com/jpablobr/active_paypal_adaptive_payment) and the option to set_payment_options:
response = ADAPTIVE_GATEWAY.setup_purchase(
:action_type => 'CREATE',
:receiver_list => recipients,
...
)
ADAPTIVE_GATEWAY.set_payment_options(
:display_options => {
:business_name => 'Big Business',
:header_image_url => 'url goes here'
},
:sender_options => {
:require_shipping_address_selection => true },
:receiver_options => [{
:description => _description,
:invoice_data => {
:item => [{
:name => _title,
:item_count => 1,
}],
:total_shipping => 10.0,
:total_tax => 10
},
:receiver => {
:email => email
}
}])
)
The issue is that it doesn't work - i do not see any business names or image, i see generic names on the left column (the one with the items and the flow doesn't ask for shipping address).
Could you please advise?
You can also do so by logging into PayPal, then going to My Selling Tools and update the Custom payment pages option to create a new page style with the color combination and logo of your choice (there are size restrictions for the logo images)

ActiveMerchant Authorize.net ARB and CIM Phone?

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.

An invalid merchant configuration in Paypal with rails

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.

Resources