Check which payment method was used using flow

Solved

Check which payment method was used using flow

Builtlikebutter
Shopify Partner
5 1 3

Hi all

 

I need to check which payment method is being used at checkout using flow. At the moment i am just trying to tag orders that use Apple Pay, Google Pay or another "digital wallet".

 

The flow is not working having tried the 2 options below. The wallet is always "empty" =, but in the transaction the wallet shows as apple pay. Is there another variable i should be using for this?

 

"wallet"=>{"apple_pay"=>{"type"=>"apple_pay"}, "dynamic_last4"=>"0000", "type"=>"apple_pay"}}, "type"=>"card"}

 

See screenshot for set-up I have used.

 

Parent Transaction / Payment Details / Card Payment Details / Wallet 

<empty>

 

Payment Details / Card Payment Details / Payment Method Name card

 

and also the non parent transaction option.

 

Screenshot 2024-01-28 at 12.50.43.png

 

TYIA

Accepted Solution (1)
Builtlikebutter
Shopify Partner
5 1 3

This is an accepted solution.

Got this working now.

The parameter was

{% for transactions_item in order.transactions %}
{{transactions_item.paymentDetails.CardPaymentDetails.wallet}}
{% endfor %}

in case anyone else is looking through this thread of the outcome.

View solution in original post

Replies 6 (6)

paul_n
Shopify Staff
1497 161 349

I don't think you want parentTransaction. Card Payment Details is obviously details related to the card, which isn't something like "Apple". If you can't tell what value a field has, you use Log output action to print it out on the workflow run page. 

 

Most likely you want transaction / formattedGateway, transaction / gateway, or just order/paymentGatewayNames . If you print out that value using Log Output, you'll see what value to use to match Apple Pay. 

Paul_N | Flow Product Manager @ Shopify
- Finding Flow useful? Leave us a review
- Need Flow help? Check out our help docs.
- Building for Flow? Check out Flow's dev docs.
Builtlikebutter
Shopify Partner
5 1 3

Thank you Paul, i have tried logging the output as i didnt know about this feature. I have tried the ones you suggested above, however even when the user pays using Apple Pay, it shows as Shopify Payments. In the transaction details, the only place "Apple" appears is under wallet, but in Flow the wallet details are always returned empty. Im not sure if this is an issue or the parameter is just not available in flow at this point. 

Builtlikebutter
Shopify Partner
5 1 3

This is an accepted solution.

Got this working now.

The parameter was

{% for transactions_item in order.transactions %}
{{transactions_item.paymentDetails.CardPaymentDetails.wallet}}
{% endfor %}

in case anyone else is looking through this thread of the outcome.
CarmineT
Shopify Partner
96 2 32

where exactly you put those string of code in the block, would you mind share a screenshot of the flow job?

Builtlikebutter
Shopify Partner
5 1 3

This was the log output. Ive deleted it now. 

 

{% for transactions_item in order.transactions %}
{{transactions_item.paymentDetails.CardPaymentDetails.wallet}}
{% endfor %}

 

This was the variable

 

transactions_item.paymentDetails.CardPaymentDetails.wallet

CarmineT
Shopify Partner
96 2 32

Thank you, in my case I needed to detect bank transfer, I was successful with thischeck_payment_type.png