Shopify Billing API status updates: frozen, expired, etc - shopify

I'm developing an app for Shopify and they show a flow diagram on this page: https://help.shopify.com/api/charging-for-your-app/recurring-application-charges
I'm doing a recurring charge, which is described here:
https://help.shopify.com/api/reference/recurringapplicationcharge
Their docs say that when a user accepts/declines a charge, the user will be sent to return_url, where I can then verify the status.
But how do I handle / get notified on the other cases where payment is interrupted:
User doesn't respond and charge becomes expired
User cancels Shopify account
User's credit card is removed/declined
User's account is frozen

If the User declines, they do not visit the confirmation URL. But if you examine the charge, its state shows declined, not pending.
If the User cancels their account, you get an uninstall webhook if you're listening for that, so you can uninstall the shop.
If the User has credit card problems Shopify takes care of that.
If the account is frozen you can just sit on it for as long you care to, and then you can delete it if things persist.

Related

PayPal and payment implementation

I am designing a website that accepts payment through simple PayPal or Stripe buttons, but also has a section that pays out users through PayPal. What is the best way to do this?
Current setup: The user builds up coins through an action (NDA won't allow me to discuss in detail) and when their coins reach a certain amount, they can cash out in real $. I have designed this flow: Pay Me Now Button -> Screen with PayPal email address input. Repeat email for typos, then Confirm Button -> Success screen
However, the client would prefer a direct link out to PayPal instead of manual input of email addresses. The reasoning is that they would prefer it being arranged through PP's service to reduce manual errors and typing out. As far as I am aware the only way to get paid is through writing down an email address/phone number. I have researched PayPal.me buttons but it still isn't making sense. Maybe there's another service altogether that I can suggest to the client for paying out users in a no-friction way?
I'm looking at how user testing sites pay people, but not getting very far.
If the money is in your client's PayPal account and they wish to send it to a user's email address (that may or may not have a PayPal account already), this can be automated with PayPal Payouts.
If the user does not have a PayPal account already they will receive an email notification and have 30 days to create an account or add the email to an existing account. If they don't, the payment will be refunded automatically.

How to set trial period in shopify app?

I have created shopify app and setting up billing Api. In the App, I want to apply trial period of 20 days. I have created the charge during the app installation and send customers to confirmation url so that they can accept or decline the charge.. So I want to know that if customer decline the payment charge, then can he uses the app featurs till trial period?
If a customer declines the subscription, you still get the confirmation URL callback. Examine the charge. The status will say declined. At this point you can kill off their DB token and destroy their session. This will ensure they cannot use your App as they declined the terms.
It is one bad aspect of the whole billing scenario. I have lots of customers that are faced with a question they don't read. So they assume the trial you offer for free is activated by declining the subscription. Silly customers... still cannot operate the Internet :)

PayPal Sandbox transactions are not showing for seller

I've used my live PayPal account to login to developer.paypal.com where I created 2 new accounts buyer# (personal) and seller# (business). I've implemented a PayPal plugin for a shop (CubeCart + PayPal Standard Payment Gateway plugin https://www.cubecart.com/extensions/payment-gateways/paypal-standard). When I complete an order (sandbox testing) I sign using buyer# email and password and complete the order. I can then click to view account and it shows "payment to", "unclaimed" and the amount I've paid. When I logout of this account and login as my buyer#, I see no transactions. If I log back into developer.paypal.com and go to transactions under "Sandbox" section and select any of the email addresses I see the same statement for all of them "You don't have any transactions".
If I login to sandbox.paypal.com using james-facilitator# account (business) there are no transactions here either.
If I login to sanbox.paypal.com using james-buyer# account (personal) there is only the one initial transaction here for the initial 9,999 funds
I've obviously missed something but I can't think what, I'm not sure how a sandbox account knows who it's seller should be but I've checked both sandbox seller accounts. I find it strange that the buyer account I used has registered the transaction but it seems like it's orphaned as there isn't any other record of it any where else including the developer.paypal.com sandbox transaction. I've tried this several times to see if I could get it working and I've also allowed for 24 hours just in case there was a delay somewhere.
I just want to be able to test transactions before going live.
Any help/advice?
Much appreciated :)
Cheers
James
Solved - silly really now I know but it was simply the email address I used to test the API. I used my main live account and I should have used the fake email address in my API call. Since my live controls the test accounts I assumed that this should have been used.

Paypal ipn processing and dropdown option/price buttons logic

I read lots of post from various sites including paypal documentations. But I have some quesitons wihch I couldnt solve those. One of them is that how to design the codes after receiving the ipn message. Ofcourse I make my code I am able to optain and process the variables of message. like payment status and I am able to save them into database. But the point is that how should I desing the code to control the payment to overcome my requirements. I know the post become long but I feel the need of this explanation. So I have a site which works with membership with payment. Site is check after login the membership trial is expired or not if it is expired it shows a div in fornt of the site wihch includes the paypal buttons and redirect to paypal payment screen when button is clicked. User shodul have ability to choos membership period like 6 or 12 mounths (by dropdown paypal button). When the user finalize his payment ipn is trrigerd and I get the datas but all my members dont have to have a paypal account so they can use therid credit card directli and if I understand correctly the transfer of money can take some time to be recevied by me. Which time interval I should set the members approved flag is true ? I am confused about this. If I approve him after ipn is sent is there a possibility an error can occure while transferring me. How the process works.
other problem is the dropdown button. when I set option/price button when I click the button an error page is shown after redirecting to my selling page. It does not redirect to the payment page.
Realy sorry for my long post but I dont know how can I descirebethe situtation in a short way
If you need to wait until funds are available, you should test the value of "payment_status" in the verified IPN message for "Completed".
An eCheck can take from 3-5 days for collection (sometimes longer; you can see the estimated hold time in your account) and has payment_status="Pending". Once collected, you will get another IPN message with "Completed".
Note that the user never sees the IPN process. Normally you set up the conditions (in a table or something that is persistent enough), then send the user to PayPal. When the user comes back from PayPal, your code (at the "return_url") checks the table to see if Payment had completed successfully (perhaps a flag, which was set by your IPN handler code that is called by/communicated with PayPal when the user leaves PayPal gracefully).

DNN Problem: Dynamic Registration, Paypal, and User Creation

I'm having a problem with the module Dynamic Registration for DNN.
The module is set up with form completion events in such a way that a user gets redirected to paypal and on completion of payment a user gets created and an email is sent out.
I also have it set up so that an email gets sent out on completion of payment, just to test that the module knows when payment has been completed.
I tried going through the process with the payment gateway (Paypal) enabled - the email gets sent out, but the user does not get created. When I disable the payment gateway, however, a user does get created as well as the email is sent out.
Is there something I'm missing here that is making the module not realize it needs to create the user?
The fact that the module sends out the email makes me think that it should also trigger the Uesr Creation event.
Any ideas/hints as to how Dynamic Registration works with Paypal or how I might be able to fix this?
When the user returns to your site from paypal you must have Friendly URL's turned on or the site can't read the data sent back from paypal.
I found the following information at http://www.datasprings.com/Products/ProductForums/tabid/727/forumid/3/tpage/1/view/topic/postid/4581/language/en-US/Default.aspx#4581
When PayPal integration is turned on:
The user is redirected to PayPal based on the information and settings within your PayPal Payment gateway. This includes the PayPal login, sandbox or standard gateway, and payment information/additional parameters.
Completion events do not get fire off initially
How do completed events get fired off?
When PayPal is enabled Dynamic Completion Events need to be ‘linked’ to PayPal IPN codes. In short, this means that you will specify within the PayPal payment gateway section which ‘completion events’ should be fired off basically conditionally upon which IPN code PayPal will send to your registration form.
For example: Maybe you want to setup a completion event to add the user to a security role, but you only want this to happen when the payment is completed. You would first create the completion event, and then you would ‘link it’ within the PayPal payment gateway section under ‘Form Completion Events / PayPal Payment Status’
For example: Maybe you want to setup a ‘Payment failed’ email to be sent to the administrator if a subscription payment fails. You would first create the completion event, and then you would ‘link it’ within the PayPal payment gateway section under ‘Form Completion Events / PayPal Payment Status’