Skip to content

Fix trial payments#7

Open
hnrqer wants to merge 1 commit intorecurly-v2019-10-10from
recurly-v2019-10-10-fix-trial-payments
Open

Fix trial payments#7
hnrqer wants to merge 1 commit intorecurly-v2019-10-10from
recurly-v2019-10-10-fix-trial-payments

Conversation

@hnrqer
Copy link

@hnrqer hnrqer commented May 30, 2020

Warning!!! Merge this only after https://github.com/Etison/mothership/pull/10206 has been merged in master and QA accepted

Overview

The issue occurs for Recurly subscription plans with a trial period and without any setup fee.

When this happens, the response returned by Recurly API doesn't have any transactions, so in order to grab the message status and the authorization uuid, we have to process the invoice differently for this type of payment by using the line_items structure and the invoice state.

  • Example of request response WITHOUT setup fee
{
  ...
  "state"=>"paid",
  "paid"=>0.0,
  "total"=>0.0,
  "subtotal"=>0.0,
  "refundable_amount"=>0.0,
  "transactions"=>[],
  "line_items"=> 
  { 
    ..., 
    "data"=>
    [
      { 
        ...
        "uuid"=>"...", 
       }
    ]
  }
}
  • Example of request response WITH setup fee
{
  ...
  "state"=>"paid",
  "paid"=>10.0,
  "total"=>10.0,
  "subtotal"=>10.0,
  "refundable_amount"=>10.0,
  "transactions"=>
  [
    {
      ...,
      "id"=>"...",
    }
  ],
  "line_items"=> 
  { 
    ..., 
    "data"=>
    [
      { 
        ...
        "uuid"=>"...", 
      }
    ]
  }
}

It is possible to see the plan setup fee configuration in Recurly by visiting Configuration -> Plans and then select your plan. The section showing the setup fee configuration is this one:

Screenshot on 2020-05-30 at 22_08_17

Pivotal Tracker Links

https://www.pivotaltracker.com/story/show/173013712

Dependency Updates

None

@hnrqer hnrqer self-assigned this May 30, 2020
@hnrqer hnrqer requested review from sergeychernyakov and removed request for sergeychernyakov May 30, 2020 01:44
@hnrqer hnrqer changed the title [WIP] Fix trial payments WIP: Fix trial payments Jun 4, 2020
@hnrqer hnrqer changed the title WIP: Fix trial payments Fix trial payments Jun 4, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants